On 03 Aug 2000 22:23:08 -0400, Chaim Frenkel wrote:
>What would be the method to _avoid_ emitting something?
>
>What would be the result of
>
> open(Foo, "Bar") # Prints FILEHANDLE=0xdeadbeef
> $x++; # Prints 3
Exactly. I can think of even more cases:
* What do you do with the "true" value at the end of a module/required
file? Some people make a habit of putting a string there, instead of
just the boring "1;".
* How about bare strings as a return value from a sub? Example:
sub test {
"This string gets printed\n";
"This is the return value.\n";
}
Then:
$a = test();
would only print the first string, assigning the second string to $a,
and
test();
would (probably) print both strings, because test() is called in a void
context, which would be inherited by the return value string. I say
"probably", because this statement might be the last statement in a
sub...
I think it's a bad idea. I would rather do it as the C64 did: use a very
short function name as an alternative to "print".
P "This gets printed!", "\n", "Yeah!\n";
Unfortunately (for you), you can't use '?' because it would be ambiguous
WRT the ?PATTERN? syntax.
--
Bart.