Think about Loose Coupling | |
PerlMonks |
Re: Easy Reference for Contextsby LanX (Saint) |
on Apr 14, 2011 at 13:42 UTC ( [id://899435]=note: print w/replies, xml ) | Need Help?? |
Well ... most of this can be tested interactively. The inside context with wantarray the outside context behavior with print, print scalar and a void call. For instance I doubted that scalar m// returns true or false (those identifiers don't exist in Perl), I thought it's the number of matches returned. But I was wrong: :)
Cheers Rolf UPDATE: Forgot to mention, you can also check the prototype for most builtins: which is more complex than just void, list and scalar... check out perlsub for details. And some builtins (like map) have such a "rich" syntax that they can't be expressed with prototypes.
In Section
Seekers of Perl Wisdom
|
|