in reply to Comma's and blocks
Why are the comma's excluded in some spots and not others?They're not excluded... you may have completely misunderstood some of the syntactic forms.
That's roughly equivalent to:map {/dothis/} @variable; grep {/more stuff/} @more;
except that map() and grep() play with $_ on your behalf.map(sub {/dothis/}, @variable); grep(sub {/more stuff/}, @more);
As for:
The second print statement is equivalent toprint A "hello"; print $somevar, "can be seperated like this";
.. unless you've called select() to change which is the default filehandle.print STDOUT $somevar, "can be seperated like this";
How does this work with your own prototypes and subroutines?Prototypes allow the Perl parser to apply (for your subs) the same parser tricks it employs on built-in functions (like push()).
Which perldoc covers this in depth?perlsyn, perlsub, perlfunc should do it.
-David
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Comma's and blocks
by zer (Deacon) on Oct 04, 2007 at 06:30 UTC | |
by erroneousBollock (Curate) on Oct 04, 2007 at 06:35 UTC | |
by mwah (Hermit) on Oct 04, 2007 at 09:41 UTC |