Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: What should be returned in scalar context?

by demerphq (Chancellor)
on Dec 02, 2003 at 17:51 UTC ( [id://311696]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    return wantarray ? @array : \@ref
    
  2. or download this
    sub get_rec {
      my $self=shift;
      print(join ",",@$self),return unless defined wantarray;
      return wantarray ? @$self : join(",",@$self);
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-18 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found