- or download this
@list = <>;
...
$number = <>; <strike># this will never be reached (or won't read any
+thing)</strike>
- or download this
open(LIST, "<$ARGV[0]");
@list = <LIST>;
close LIST;
- or download this
print "Pick a number between 1 and ",scalar @list,": ";
$line_no = <STDIN>;
chomp $line_no;
print "Contents of line # $line_no in $ARGV[0]:\n$list[$line_no-1]\n";