jimbus has asked for the wisdom of the Perl Monks concerning the following question:
Brethren
when looping through a list of filenames, I need to see is which element of an array of lines from a CSV file it is and append a couple values to it.
I was thinking of preprocessing the array, parsing the info I need from each line and creating a hash of the substring and the original string, then I could do a direct lookup to modify the original line and walk the keys to regenerate the file. but I was thinking there had to be a more direct way of doing it
I looked at grep and first, but it returns the values and not the element number.
Any thoughts?
Thanks,
Jimbus
Never moon a werewolf!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Array searching, grep, first
by ChrisR (Hermit) on Sep 01, 2005 at 17:46 UTC | |
by diotalevi (Canon) on Sep 01, 2005 at 19:02 UTC | |
by ChrisR (Hermit) on Sep 01, 2005 at 19:07 UTC | |
by jimbus (Friar) on Sep 01, 2005 at 18:13 UTC | |
by friedo (Prior) on Sep 01, 2005 at 18:29 UTC | |
Re: Array searching, grep, first
by friedo (Prior) on Sep 01, 2005 at 17:20 UTC | |
Re: Array searching, grep, first
by eff_i_g (Curate) on Sep 01, 2005 at 17:29 UTC | |
Re: Array searching, grep, first
by tye (Sage) on Sep 02, 2005 at 01:20 UTC |
Back to
Seekers of Perl Wisdom