overrider88 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w $ffdb=("ffdb.dat"); open(FILE, "$ffdb"); @ffdbdata=<FILE>; close FILE; print "Enter ID \n"; $ID = <STDIN>; chomp($ID); if ($ID eq "") { print "Cant be empty!\n"; } open(FILE, ">$ffdb"); foreach $line (@ffdbdata) { $line=~ s/\n//g; @column=split /\|/, "$line"; if ($column[0] eq $ID) { if ($column[1] eq IN) { print FILE "$column[0]|OUT\n"; } else { print FILE "$column[0]|IN\n"; } } else { print FILE "$line\n"; } } close FILE; exit(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: nested if statement wont work
by davidrw (Prior) on Apr 25, 2006 at 15:48 UTC | |
|
Re: nested if statement wont work
by Hue-Bond (Priest) on Apr 25, 2006 at 15:58 UTC | |
|
Re: nested if statement wont work
by swampyankee (Parson) on Apr 25, 2006 at 16:25 UTC | |
|
Re: nested if statement wont work
by jwkrahn (Abbot) on Apr 25, 2006 at 21:06 UTC |