OldMonkRum has asked for the wisdom of the Perl Monks concerning the following question:
In Getopt I have "tlef:s@" => \$optsHash->{tlef}, which could be single or array. I moved to 5.20.2
if($self->{tlef}){ if(@{$self->{tlef}}) {
If tlef is defined once then I want to check if its an array. Previously if if(defined @{$self->{tlef}}) { was working. Now its deprecated, so if I remove define, I get the cant use string as ref issue. Is there an easy way to check if the command line option from GetOpt is array or single element?
Regards.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't use string as an ARRAY ref
by kcott (Archbishop) on Oct 07, 2015 at 06:24 UTC | |
by OldMonkRum (Novice) on Oct 07, 2015 at 06:30 UTC | |
by kcott (Archbishop) on Oct 07, 2015 at 06:38 UTC |