in reply to extract data from line
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
|
|---|