- or download this
use strict;
use warnings;
...
ok( !eval { foo( [] ) }, 'bad input: array ref' );
ok( eval { foo( +{ 1 => 1 }) }, 'good input' );
__END__
- or download this
UNIVERSAL::isa( $_[0], 'HASH' ) and ( my %hr = %{ shift() } or die;
- or download this
UNIVERSAL::isa( $_[0], 'HASH' ) and my $hr = shift or die;
- 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()?)