Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Context aware functions - best practices?

by ihb (Deacon)
on Jan 15, 2003 at 22:40 UTC ( [id://227255]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      return wantarray ? @arr : $arr[-1];
  2. or download this
      return @arr[0..$#arr];
  3. or download this
      my ($x) = foo(...);
  4. or download this
      sub get_headers {
        my $self = shift;
        my @headers = @_;
    ...
        my @values = @{$self->{headers}}{@headers};
        return @values;
      }
    
  5. or download this
      my ($recipient, $sender) = $obj->get_headers('to', 'from');
  6. or download this
      my ($recipient) = $obj->get_headers('to');
  7. or download this
      return wantarray ? @values : $values[0];
  8. or download this
      my $recipient = $obj->get_headers('to');
  9. or download this
      my $recipient = $obj->get_headers('to', 'from');
  10. or download this
      return @results if wantarray;
      carp("More than one value in result in scalar context")
        if @results > 1;
      return $results[0];
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found