in reply to Re: Creating 'new' subroutine.
in thread Creating 'new' subroutine.
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Creating 'new' subroutine.
by tobyink (Canon) on Oct 11, 2013 at 12:04 UTC | |
|
Re^3: Creating 'new' subroutine.
by Anonymous Monk on Oct 11, 2013 at 20:35 UTC | |
|
Re^3: Creating 'new' subroutine.
by boftx (Deacon) on Oct 12, 2013 at 00:52 UTC |