in reply to Re^4: read a hash from a file
in thread read a hash from a file

I cannot directly use this but what happens if you add the following to my code above:

my $record = REC->new( %data ); print Dumper( $record );

Replies are listed 'Best First'.
Re^6: read a hash from a file
by Anonymous Monk on Apr 16, 2013 at 07:20 UTC
    It works! You are a genuis! Is there anyway to do it without using the intermediary %data ?

      Try this:

      my $record = REC->new( map{ s/#.*//; s/^\s+//; s/\s+$//; m/(.*?)\s*=\s*(.*)/; } read_file($file) );