#! perl -sw use strict; use Data::Dumper; my $source = do {local $/; }; # Slurp the source # build an array of chunks that look like parms to Lique() my (@parms) = $source =~ m/=\s+(?:new\s+)?CX::Lique(?:->new\s*?)?\((.*?)\);/gcs; # Processs the array and build a hash from the chunks. for my $parm (@parms) { my %info; $parm =~ s/'?(\w+)'?\s+=>\s+'?([^,')]+)'?,?\n/$info{$1} = $2;/seg; print Dumper(\%info); } __DATA__ my $fun = new CX::Lique( name => 'Test Addon', 'author'=> 'nutshell', email => 'x@x.com', descrip => 'That', version => '1.1', build => 2 ); my $q = CX::Lique->new( name => 'Test', 'author'=> 'yeehaw', 'email' => 'yeehaw@yahoo.com', descrip => 'Fun', version => '1.11', build => 2 );