tlynch001 has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/bin/perl -w # Open our datafile open(INPUT, '< graduate.output.txt') or die "Couldn't open the file for reading\n"; # Declare main array @MainArray = (); # build a data structure @url_info = <[INPUT]>; while(1){ print "Pick a number: "; $index = <STDIN>; if($index eq 'Q'){ last; } print "Link: $url_info[$index][0]\n"; }
But the print only displays the work Link:
Of course, this is rigged to only print the URL. But I'm still troubleshooting.
And why doesn't my loop quit if I type a Q?
Thank you very much!
-tl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array question II
by japhy (Canon) on Mar 14, 2001 at 20:21 UTC | |
by tlynch001 (Initiate) on Mar 14, 2001 at 20:48 UTC | |
by davorg (Chancellor) on Mar 14, 2001 at 20:53 UTC | |
|
Re: Array question II
by buckaduck (Chaplain) on Mar 14, 2001 at 20:56 UTC |