John007 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl local ($bak_id)=shift; local ($acc_bal)=shift; $bak_id=<STDIN>; $acc_bal=<STDIN>; chomp ($bak_id); print "bak_id = $bak_id\n"; print "acc_bal = $acc_bal\n"; if (($acc_bal < 1.0 ) && ($bak_id eq "BOTH")) { print "condition 1\n"; } elsif (($acc_bal > 1.0 )&&($bak_id eq "BOTH")){ print "condition 2\n"; } elsif (($acc_bal < 1.0 ) && ($bak_id eq ("Cust1")||("Cust2"))) { print "condition 3\n"; } elsif (($acc_bal > 1.0 ) && ($bak_id eq ("Cust1"||"Cust2"))) { print "condition 4\n"; local ($choice); $choice=<STDIN>; if ($choice="YES") { print "condition 4.1\n" } elsif ($choice!="YES") { print "condition 4.2\n"; } } elsif (($bak_id eq "\n") || ($acc_bal eq "\n")) { print "return to MM\n"; } else { print ("Returning to Main Menu\n"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Detecting a Null or Enter key
by swampyankee (Parson) on Jan 11, 2009 at 14:32 UTC | |
|
Re: Detecting a Null or Enter key
by Bloodnok (Vicar) on Jan 11, 2009 at 14:54 UTC | |
by ikegami (Patriarch) on Jan 11, 2009 at 18:12 UTC | |
by Bloodnok (Vicar) on Jan 11, 2009 at 18:20 UTC | |
by ikegami (Patriarch) on Jan 11, 2009 at 18:30 UTC | |
by Bloodnok (Vicar) on Jan 11, 2009 at 20:51 UTC | |
|
Re: Detecting a Null or Enter key
by swampyankee (Parson) on Jan 11, 2009 at 17:41 UTC | |
|
Re: Detecting a Null or Enter key
by cdarke (Prior) on Jan 12, 2009 at 10:48 UTC |