yoda54 has asked for the wisdom of the Perl Monks concerning the following question:
Please enlighten.
What am I doing wrong here? I'm trying to decompose a string but for some reason I get uninitialized values.
Thanks!
sub test { my $a = shift; $a =~ /(.)(.)(.)(..)(.+)/; return 0 if ($1 !~ /(a)/); return 0 if ($2 !~ /(d|p|t)/); return 0 if ($3 !~ /(a|h|r|s|t)/); return 0 if ($4 !~ /(aw|er|dd|cb|aa)/); }
Use of uninitialized value $2 in pattern match (m//) at
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: What is this erroring out?
by Corion (Patriarch) on Mar 16, 2010 at 08:02 UTC | |
by yoda54 (Monk) on Mar 16, 2010 at 08:05 UTC | |
Re: What is this erroring out?
by Hue-Bond (Priest) on Mar 16, 2010 at 08:03 UTC | |
by yoda54 (Monk) on Mar 16, 2010 at 08:08 UTC |