Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: references best practice (wantarray)

by lodin (Hermit)
on Apr 25, 2008 at 14:35 UTC ( [id://682839]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foobar {
      ...
      return wantarray ? @foobar : \@foobar;
    }
    
  2. or download this
          | foo       | bar      | foobar      | "best"
    ------+-----------+----------+-------------+-------------
    List  | foo()     | @{bar()} | foobar()    | foo / foobar
    Ref   | [ foo() ] | bar()    | foobar()    | bar / foobar
    Count | foo()     | @{bar()} | @{foobar()} | foo
    
  3. or download this
          | foo       | bar      | foobar
    ------+-----------+----------+--------
    List  | copy      | copy     | copy
    Ref   | copy      | no-copy  | no-copy
    Count | no-copy   | no-copy  | no-copy
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-19 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found