
sleuth
Enthusiast
Feb 16, 2001, 12:41 AM
Post #10 of 13
(986 views)
|
I get it, What he wants to do is assign the first field of each line to a hash, then he wants to call that line by the name of the first field through the hash then slpit the fields and do other stuff with them. At least that what I came up with outta that explantation. Anway, if it helps to do what I just said you'd have to do this, open(data, "database.dat"); while(<data>){ (@fields)=split(/\|/, $_); $fields{$fields[0]}=$_; } close(data); Now you can call your lines by the number in the first field, print "$fields{'934'}"; OUTPUT: 934|yotam|o@m.c|774389489 Tony
|