my $record = REC->new( NAME => 'John Smith', AGE => '15', RANK => 'Tier 1', URL => 'http://somesite.com', ); #### NAME=John Smith AGE=15 RANK=Tier 1 URL=http://somesite.com ) #### my record =map{ s/#.*//; s/^\s+//; s/\s+$//; m/(.*?)\s*=\s*(.*)/; } read_file($file);