in reply to extract data from line

Look in the Plain Old Documentation under "perlfunc -f split" for info on what this snippet does.

my %info; foreach my $line ( @lines ) { foreach my $pair ( split /\s*,\s*/, $line ) { my ( $key, $value ) = split /\s*=\s*/, $pair; $info{$key} = $value; } }

If your keys are more complex, ie allow embeded commas, and such, you'll have to come up with a more robust solution, but this works fine for simple datasets.


Dave