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.

map {/dothis/} @variable; grep {/more stuff/} @more;
That's roughly equivalent to:
map(sub {/dothis/}, @variable); grep(sub {/more stuff/}, @more);
except that map() and grep() play with $_ on your behalf.

As for:

print A "hello"; print $somevar, "can be seperated like this";
The second print statement is equivalent to
print STDOUT $somevar, "can be seperated like this";
.. unless you've called select() to change which is the default filehandle.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.