2007-02-20

user input in perl


#!/usr/bin/env perl
if ( $ARGV[0] eq "" ){
while ( $num eq "" ){
print "Please enter something: ";
$num = <STDIN>;
chomp $num;
}
}
else {
$num = $ARGV[0];
}
print "You entered: $num\n";

No comments: