http://qs1969.pair.com?node_id=642569

zer has asked for the wisdom of the Perl Monks concerning the following question:

Good morning,

I have come across some interesting questions from some friends on the use of comma's within the perl language. It appears that arguments for all subroutines are comma delimited. However when you come accross map/grep it changes

map {/dothis/} @variable; grep {/more stuff/} @more;
The proper formating is for blocks to be without a comma. Then with non-blocked items it would return to the comma. Another example is with the print statement.

open (A, ">File") or die; print A "hello"; print $somevar, "can be seperated like this";
So in this portion you are sending a file handle and it doesnt accept a comma. If you were to use seek it would be comma seperated. Which makes me ask...

  1. Why are the comma's excluded in some spots and not others?
  2. How does this work with your own prototypes and subroutines?
  3. Which perldoc covers this in depth?