Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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]
[Discipulus]: planetscape welcome back! (or is well comeback?)
[Discipulus]: fore every 2 good old monks that come back, we will accept 1 clinical
[planetscape]: Might be "well, come back!" Discipulus ;-)
[stonecolddevin]: that's a 2.0 k/d ratio, i'll take it
[choroba]: #cbstream still down?
[erix]: yeah, annoying
[choroba]: last ambrus: 1 week ago :-(
[erix]: let's invade Hungary

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2017-06-22 21:02 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (530 votes). Check out past polls.