Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!uvaarpa!mmdf From: marc@athena.mit.edu Newsgroups: comp.lang.perl Subject: two possible bugs Message-ID: <1990Aug9.054219.15749@uvaarpa.Virginia.EDU> Date: 9 Aug 90 05:42:19 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: marc@mit.edu Organization: The Internet Lines: 74 Possible Bug 1: This program: #!/mit/watchmaker/@sys/perl sub foo { local($bar); $_[0] = "frep"; print "\$bar = \"$bar\"\n"; } $bar = "string"; &foo($bar); print "\$bar = \"$bar\"\n"; prints: $bar = "frep" $bar = "string" This is, at best, confusing. What is it doing, and is it a bug? What's it supposed to do? Possible bug 2: perl man page (pl 18): sprintf(FORMAT,LIST) Returns a string formatted by the usual printf con- ventions. The * character is not supported. printf/sprintf man page (BSD 4.3, possibly enhanced locally) Each conversion specification is introduced by the character ``%''. The remainder of the conversion specification includes in the following order: + Zero or more of the following flags: ... - A blank which specifies that a blank is to precede any non-negative value in d, e, E, f, g, or G conversion. C program: main() { printf("\"% f\"\n",3.1416); } C output: " 3.141600" perl script: #!/mit/watchmaker/@sys/perl printf("\"% f\"\n",3.1416); perl output: "" f" The C and perl outputs obviously do not match. In any case, I have no clue how the perl output comes from the script I gave it. Again, what's happening? I'm pretty sure that this is a bug, and that the C and perl outputs should match. Marc