Help for this page

Select Code to Download


  1. or download this
    $ perl -w
    sub nothing { return; }
    ...
    __END__
    foo has 0 elements after pushing nothing.
    foo has 1 element after pushing something.
    
  2. or download this
    sub foo {
        return !! shift->{some_obj}->some_method;
    }
    
  3. or download this
    sub foo {
        return ( shift->{some_obj}->some_method ) ? 1 : 0;
    }
    
  4. or download this
    sub foo {
        return ( shift->{some_obj}->some_method ) ? 1 : ();
    }
    
  5. or download this
    sub foo {
        return shift->{some_obj}->some_method || ();
    }