Angharad has asked for the wisdom of the Perl Monks concerning the following question:
In a nutshell - the length of the 'Z item' corresponds to the numbers following it. For example, the first Z item starts at element 5 and ends at element 89, making it 84 elements in length.Z 5 89 Z 92 102 Z 103 123 Z 126 150
Is in reality only one Z item, yet in the file its recognised as two.Z 92 102 Z 103 123
Any pointers in the right direction much appreciated.open(FILE, "$input") || die "OOPS! Can't find file!\n"; while(<FILE>) { @file = split(/\s+/, $_); $zitem = $file[0]; if("$zitem" eq "Z") { $start_element = $file[1]; $stop_element = $file[2]; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 'rewinding' file to get value from previous line in file?
by sauoq (Abbot) on Dec 07, 2006 at 17:43 UTC | |
by ikegami (Patriarch) on Dec 07, 2006 at 19:00 UTC | |
| |
|
Re: 'rewinding' file to get value from previous line in file?
by Not_a_Number (Prior) on Dec 07, 2006 at 21:22 UTC |