BigRare has asked for the wisdom of the Perl Monks concerning the following question:
I know this does not work, but I do not know why.#!/usr/bin/perl -w # This script should ask for a list, a number, then display # the line entered of the list in reference to the number print "Hello, please enter a list:/n"; @list=<>; chomp @list; print "Now, enter a number:/n"; $number=<>; chomp $number; # OK, now print the results print "Line $number was: $list[$number-1]";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: printing array and string on same line
by sauoq (Abbot) on Jun 11, 2003 at 00:11 UTC | |
by BigRare (Pilgrim) on Jun 11, 2003 at 00:28 UTC | |
by sauoq (Abbot) on Jun 11, 2003 at 00:56 UTC | |
by BigRare (Pilgrim) on Jun 11, 2003 at 03:24 UTC | |
Re: printing array and string on same line
by graff (Chancellor) on Jun 11, 2003 at 06:47 UTC | |
by sauoq (Abbot) on Jun 11, 2003 at 07:08 UTC | |
by BigRare (Pilgrim) on Jun 11, 2003 at 18:08 UTC |