On 2012-11-15 03:07, Uri Guttman wrote:
my %hash = read_file( 'file.txt' ) =~ /^(.+)\s*=>\s*(.+)$/mg ;
Trailing whitespace in the keys? Skipping empty values? my %kv= read_file( 'file.txt' ) =~ /^(.+?)\s*=>\s*(.*)/mg; and without File::Slurp: my %kv= map m/(.+?)\s*=>\s*(.*)/, <$fh>; (all untested) -- Ruud -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
