Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: context-sensitivity for selfwritten functions

by rob_au (Abbot)
on Jan 28, 2004 at 09:06 UTC ( #324625=note: print w/ replies, xml ) Need Help??


in reply to context-sensitivity for selfwritten functions

In order to distinguish between scalar and list return contexts, take a look at the wantarray function - See perldoc -f wantarray).

This functionality has been expanded further in the Want module which provides a greater generalisation of return contexts including top level contexts such as void, scalar and list, lvalue subroutine context and referential contexts (such as scalar, hash, array, object and alike).

 

perl -le "print unpack'N', pack'B32', '00000000000000000000001010111000'"


Comment on Re: context-sensitivity for selfwritten functions
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://324625]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-07 13:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls