Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    ok( !eval { foo( [] ) }, 'bad input: array ref' );
    ok( eval { foo( +{ 1 => 1 }) }, 'good input' );
    __END__
    
  2. or download this
    UNIVERSAL::isa( $_[0], 'HASH' ) and ( my %hr = %{ shift() } or die;
    
  3. or download this
    UNIVERSAL::isa( $_[0], 'HASH' ) and my $hr = shift or die;
    
  4. or download this
    UNIVERSAL::isa( $_[0], 'HASH' ) and defined( my %h = %{ shift() } ) or
    + die;
    #...
    ...
    defined(@array) is deprecated at -e line 1.
            (Maybe you should just omit the defined()?)