Perl-Sensitive Sunglasses | |
PerlMonks |
Re: File Manipulation - Need Advise!by blue_cowdawg (Monsignor) |
on Jan 03, 2008 at 18:58 UTC ( [id://660297]=note: print w/replies, xml ) | Need Help?? |
Dear Monk, Consider the following code:
The way this works is you are going to overwrite subsequent records that you read in for the same host in the hash %storage and as a result get the last record in your data set output. Since you said in CB you don't know if your fields are space or tab separated I covered both bases by using the regex /[\s\t\n]+/ in the split callout. Hope this helps Peter L. Berghold -- Unix Professional Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
In Section
Seekers of Perl Wisdom
|
|