in reply to getting an auto carriage return on STDIN

perllearner,
I am not sure I understand completely, but I think the following does what you want:
print "Scan in Bar Code: "; my $bar_code = <STDIN>; chomp $bar_code; if ( $bar_code ) { print "\n"; } else { select(undef, undef, undef, .5); print "\r"; }
If this isn't what you want you are going to have to be more clear. You should also use CODE tags for your code so you get proper indentation.

Cheers - L~R