Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ "fred", "barney",undef,"pebbles", "bambam", "dino", ],
[ "homer",undef,"bart",undef, "marge", "maggie", ],
[ "george", "jane",undef, "elroy",undef,"judy", ],
];
print Dumper $ref_to_AoA;
print $ref_to_AoA->[0]->[0];
[mohan@localhost ~]$ ./dymmy.pl
$VAR1 = [
[
'fred',
'barney',
undef,
'pebbles',
'bambam',
'dino'
],
[
'homer',
undef,
'bart',
undef,
'marge',
'maggie'
],
[
'george',
'jane',
undef,
'elroy',
undef,
'judy'
]
];
To print 'fred' , I can use like : print $ref_to_AoA->[0]->[0];
But What I want is, I want to replace all 'undef' to a string 'foo'. What
is the efficient way I will replace it (the array is larger then what I am
showing above). Any help and explanation will be appreciated.
Thanks & Rg
Mohan L