in reply to Re: RFC: New style for argument check in subs
in thread RFC: New style for argument check in subs
Here using ternaries is far more explicit and shows that a special argument undef is accepted.
my $a = exists $arg{a} ? $arg{a} : 'else case';
But I agree that it's better to name the error die('Undefined argument!') instead of 'Missing argument' to avoid such misunderstandings.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC: New style for argument check in subs
by Tux (Canon) on Sep 05, 2012 at 15:05 UTC | |
by LanX (Saint) on Sep 05, 2012 at 15:30 UTC |