Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Desperatly seeking the wisdom of the Monks

by earthboundmisfit (Chaplain)
on Oct 26, 2001 at 21:05 UTC ( #121666=note: print w/replies, xml ) Need Help??


in reply to Problem with while loop

Let's take one piece of your code and rewrite it a bit:
open (FILE, "$file") || die "Can't open $file"; $tmp=<FILE>; foreach(split(/\t/,$tmp)){ push(@hashkeys, $_); }
This takes only the first line of the file. I think what you want is:
my @hashkeys; open (FILE, "$file") || die "Can't open $file"; my @lines=<FILE>; foreach my $line (@lines){ my @fields = (split(/\t/,$line){ push(@hashkeys, $fields[0]); # or perhaps it's some ot +her # field you want? }
This isn't meant as a definitive answer but merely a small illustrative example to help you sort out exactly what you want to do

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://121666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2022-08-08 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?