Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
On every iteration only the "else" block runs and my output is basically:for ($y = 0; $y < $length ; $y++ ) { my($arg); $arg = $_[$y]; if ( length $arg == 1 ) { $and = $and . " AND j$y.LumbolValue = '$arg' " ; } elsif ( $arg eq "vowel\n"){ $and = $and . " AND j$y.Vowel = 1 " ; } elsif ( $arg eq "consonant\n"){ $and = $and . " AND j$y.Consonant = 1 " ; } elsif ( $arg eq "alpha\n"){ $and = $and . " AND j$y.Letter = 1 " ; } else { $and = $and . " /* else: y: $y arg: [$arg] */ " ; } }
I originally tried writing the eq statements without \n but added those chracters after is supposedly was helpful to someone else. Thanks in advance for any help, I have been stuck on this for over an hour so any help would be extremely welcome./* else: y: 0 arg: [vowel] */ /* else: y: 1 arg: [c] */ /* else: y: 2 +arg: [e] */ /* else: y: 3 arg: [consonant] */
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eq statement not working
by roubi (Hermit) on Apr 29, 2009 at 03:07 UTC | |
by Anonymous Monk on Apr 29, 2009 at 03:31 UTC | |
by roubi (Hermit) on Apr 29, 2009 at 04:03 UTC | |
by Anonymous Monk on Apr 29, 2009 at 04:47 UTC | |
|
Re: eq statement not working
by Anonymous Monk on Apr 29, 2009 at 03:05 UTC |