Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: references best practice (wantarray)

by lodin (Hermit)
on Apr 25, 2008 at 14:35 UTC ( #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? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-05-16 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (63 votes). Check out past polls.

    Notices?