Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Data::Rmap to modify an arrayref of arrayrefs

by Khen1950fx (Canon)
on Jul 02, 2011 at 22:57 UTC ( [id://912505]=note: print w/replies, xml ) Need Help??


in reply to Data::Rmap to modify an arrayref of arrayrefs

I tried it without
} else { $_ = $_; }
It didn't work. I tried return in its place, but that also doesn't work, so I just used $_;.
#!/usr/bin/perl use strict; use warnings; use Data::Rmap qw(:all); use Data::Dump qw(dump); use Storable qw(dclone); my $initial = ['note', ['shopping', ['item']]]; my $clone = dclone $initial; my($dump) = rmap_all { if( ref and $_->[0] eq 'shopping' ) { my @item = map { [ 'item' => '=>' => $_ ] } qw(bread butter beans) +; my $newdata = [ shopping => \@item ]; $_ = $newdata; } else { $_ } } $clone; print dump($dump);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://912505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-03-28 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found