Perl x Open Food Facts Hackathon: Paris, France - May 24-25 Learn more
12345678910111213 #!perluse strict;use warnings FATAL => 'all';use Test::More tests => 2;use Function::Parameters qw(:lax);fun empty ($x) {}is scalar empty(1), undef, "empty func returns nothing (scalar context)";is_deeply [empty(1,2)], [], "empty func returns nothing (list context)";__END__
#!perl
use
strict;
warnings
FATAL
=>
'all'
;
Test::More
tests
=> 2;
Function::Parameters
qw(:lax)
fun empty (
$x
) {}
is
scalar
empty(1),
undef
,
"empty func returns nothing (scalar context)"
is_deeply [empty(1,2)], [],
"empty func returns nothing (list context)"
__END__