Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Context aware functions - best practices?

by ihb (Deacon)
on Jan 15, 2003 at 22:40 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2020-02-26 20:29 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (117 votes). Check out past polls.