Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
...I had initially written @{$exceptions{$user}}, which was short and sweet. But that fails if $user isn't a key of %exceptions. It seems overly complicated and verbose to have to check to see if $exceptions{$user} is defined before treating it as an array reference.defined($exceptions{$user}) ? (join " ",@{$exceptions{$user}} : ""
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: overcoming undef as Array ref
by ysth (Canon) on Mar 29, 2007 at 21:55 UTC | |
by Anonymous Monk on Mar 29, 2007 at 22:34 UTC | |
|
Re: overcoming undef as Array ref
by rlb3 (Deacon) on Mar 29, 2007 at 21:42 UTC |