develooper Front page | perl.beginners | Postings from March 2012

FH as a value from a list

Thread Next
From:
Lancashire, Pete
Date:
March 5, 2012 10:34
Subject:
FH as a value from a list
Message ID:
955E521BF6D5DE48A9413310E8C0A14716C4801760@MAIL1.rose.portland.local
my brain this morning is blocked on this one

I have a file something like

cpu01  value value value
cpu02  value value value
cpu03  value value value
...
cpu01  value value value
cpu02  value value value
cpu03  value value value
...
cpu01  value value value
cpu02  value value value
cpu03  value value value
...

in this example column 1 can be cpu\d+ and cpu_all other it can be even eth0, fcs0 etc

I want to open files for writing, one for each unique value in the first column,
so that if the value of the data in the first column is "cpu01" then
write to the file with the FH in the variable $cpu01 or if the value is "cpu_all" write to the
file with the FH assigned to the the vaule $cpu_all

This has to be simple ...
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About