You're close.
push @employees_my_try, ( map { if( my($idx, $rest) = $_ =~ m/^employee\[(.*?)\] = new employee_ +element\((.*)\);$/ ) { my @split = map { s/\A"(.*)"\z/$1/; $_ } split( /,/, $rest ); [ $idx, @split ] } else { () } } split "\n", $data ); print Dumper \@employees_my_try;
In reply to Re: Parsing and Matching Text with Map
by Fletch
in thread Parsing and Matching Text with Map
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |