in reply to Detecting a Null or Enter key

What happens if $acc_bal is exactly 1.0? You are doing a chomp on $bak_id, so it can never be "\n" (unless you changed $/). In might also be a good idea to chomp $acc_bal, if only for consistency.

I was trying to use Switch fuction but its not working in PERL V 5.8.4

Yes, pity Switch was put into the base. The switch/case statement has had a chequered history. There is a new one in 5.10, but for now:
#!/usr/bin/perl use strict; use warnings; my $bak_id; my $acc_bal; chomp($bak_id =<STDIN>); chomp($acc_bal=<STDIN>); SWITCH: { (!$bak_id or !$acc_bal) && do { print "Returning to Main Menu\n"; return; # or somesuch }; ($acc_bal < 1.0 && $bak_id eq "BOTH") && do { print "condition 1\n"; last SWITCH }; ($acc_bal > 1.0 && $bak_id eq "BOTH") && do { print "condition 2\n"; last SWITCH }; ($acc_bal < 1.0 && $bak_id =~ /^Cust[12]$/) && do { print "condition 3\n"; last SWITCH }; ($acc_bal > 1.0 && $bak_id =~ /^Cust[12]$/) && do { print "condition 4\n"; # blah, blah, blah last SWITCH }; print "Invalid entry\n"; }