L
leegold
What if a user presses enter for the line number?
Please see below.
How will I test for that and make $linenum default to 1 ?
IE. what's the value of STDIN when someone just hits return?
So I can test for that and make default eq. to 1.
Or is there some automagic?
Thanks
my $linenum;
......snip...
print "What's your line number? [1]\n"; $linenum = <STDIN>;
chomp(&linenum);
IF (not $linenum =~ m/^\d+$/) {
die "only positive integers accepted\n";
}
......
Please see below.
How will I test for that and make $linenum default to 1 ?
IE. what's the value of STDIN when someone just hits return?
So I can test for that and make default eq. to 1.
Or is there some automagic?
Thanks
my $linenum;
......snip...
print "What's your line number? [1]\n"; $linenum = <STDIN>;
chomp(&linenum);
IF (not $linenum =~ m/^\d+$/) {
die "only positive integers accepted\n";
}
......