On Thu, 29 Jul 2004 12:08:20 -0400 (EDT), Jeff 'japhy' Pinyan wrote
>
> That's why he broke it down. Is the map() really the problem, or is
> it the regex, the ?: operator, and the two array references?
All of the above ;), but now that I think about it the map looks easiest, then
?: (which I also prefer not to use, along with unless). At least map is a
word instead of a (cryptic) token.
> >I like the convenient functionality, but I don't like the syntax. I don't
> >understand why there is no between logic and @data here:
> >
> >print join( $/, sort( { $a <=> $b } @data ));
>
> I'm not sure I understand YOU. Did you mean "... why there is COMMA
> between THE SORT logic and @data here:"? That makes more sense.
Yep, typo on sort, thought the other was obvious.
> The reason there's no comma is because Perl's grammar says you don't
> put commas after blocks like that.
Great, maybe this is what I'm missing - what is the difference between
sort/map/grep blocks and other blocks? I don't understand why I would want
multiple syntaxes for what I consider function calls. Just out of curiosity,
what other functions/blocks work this way?
Thanks again,
-John
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>