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
In reply to Re: Comma's and blocks
by erroneousBollock
in thread Comma's and blocks
by zer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |