Works great! And what it does is take the source for a my $obj = new FooBar( 'key' => 'that' ); and put the parms in %Data.# build an array of chunks that look like parms my (@parms) = $source =~ m/=\s+(?:new\s+)?FooBar(?:->new\s*?)?\((.*?)\ +);/gcs; # Processs the array and build a hash from the chunks. eval "\$Data = {" . join('', @parms) . ' };';
Thanks for making me think about using split!! :)
--nutshell
In reply to Re: Regexing a hash line thing
by nutshell
in thread Regexing a hash line thing
by nutshell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |