in reply to Better way to perform "double split" ?
That leaves you with an array of arrays like [ ['2009-11-05 17:59:52', '1.501'], ...]. If you prefer a hash, simply make itmy @result = map { [split /\s+/] } split /\n/, $cmd_output
You probably have to ensure you exclude the header lines in your input file, like so:my %result = map { (split /\s+/) } split /\n/, $cmd_output
This only processes lines that start with a couple of numbers. It should be sufficient in this case. Read up about grep, map and sort. They're powerful tools.my @result = map { [split /\s+/] } grep { /^\d+/ } split /\n/, $cmd_ou +tput
|
|---|