Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm maintaining code that was handling only numerical inputs. Now the input may be a hash reference or a number. How can I filter out the hash reference inputs? My code is sort of like this now:
if ($val =~ /^([\d]+)\'[b]([01]+)$/) { $strlen = $1; my $binstr = $2; #do things ... } else { print "Wrong kind of input"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: function input may be hash ref
by tobyink (Canon) on Mar 14, 2013 at 18:36 UTC | |
|
Re: function input may be hash ref
by toolic (Bishop) on Mar 14, 2013 at 18:35 UTC | |
|
Re: function input may be hash ref
by arnaud99 (Beadle) on Mar 14, 2013 at 18:52 UTC |