Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Running it gives#! /usr/bin/perl while(<DATA>) { chomp($_) ; if ( $_ == "aaaa" ) { print "$_\n" ; } else { print "OK\n" ; } } __DATA__ aaaa bbbb cccc dddd
I expectedaaaa bbbb cccc dddd
Any help would be appreciated!aaaa OK OK OK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: if statement not working
by GrandFather (Saint) on Feb 08, 2009 at 09:12 UTC | |
|
Re: if statement not working
by alienmonk (Initiate) on Feb 08, 2009 at 09:42 UTC | |
|
Re: if statement not working
by Anonymous Monk on Feb 08, 2009 at 09:12 UTC | |
|
Re: if statement not working
by salazar (Scribe) on Feb 08, 2009 at 23:52 UTC |