in reply to Re: How can I read a line of text from a file into an array?
in thread How can I read a line of text from a file into an array?
or get rid of the quotes and as long as your keys and values don't contain any commas you could do...
$line = 'key1,value1,key2,value2'; my %foo = split ',', $line; print $foo{key2}; #prints the value associated with key2, i.e. value2
- Ant
|
|---|