Good point, w/o testing I'd say yes !
Maybe the intention was to check if @_ has even number of elements?
Still with testing.
DB<112> use Data::Dump qw/pp/ DB<113> sub tst { pp (scalar @_ ? {@_} : {}); pp {@_};()} DB<114> tst {} {} DB<115> tst a { a => undef } { a => undef } DB<116> tst a,1 { a => 1 } { a => 1 }
Cheers Rolf
( addicted to the Perl Programming Language)
In reply to Re^2: Creating 'new' subroutine.
by LanX
in thread Creating 'new' subroutine.
by nitin.sh1982
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |