Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: What should be returned in scalar context?

by BrowserUk (Patriarch)
on Dec 02, 2003 at 21:54 UTC ( [id://311752]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
    sub dostuff {
    ...
    ...
    
    my @returned = dostuff();
    
  2. or download this
    sub DoSomething {
       my @array;
    ...
    }
    ...
    my @returned = DoSomething();
    
  3. or download this
    sub DoStuff {
        die 'Nothing to do in a void context' 
    ...
        # If we were called in an array context.
        return;  
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found