in reply to Parsing and Matching Text with Map
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing and Matching Text with Map
by awohld (Hermit) on Oct 05, 2006 at 19:19 UTC | |
by shmem (Chancellor) on Oct 05, 2006 at 19:55 UTC |