in reply to help needed with map

I'm not sure I understand correct since the two snippets are equivalent. I'm assuming you're looking for help converting the memory structure in the first snippet into the string shown in the second snippet. This works:

sub bracket { local $_ = @_ ? $_[0] : $_; return "[ $_ ]"; } sub quote { local $_ = @_ ? $_[0] : $_; s/(["\\])/\\$1/g; return qq{"$_"}; } @{$_[0]->{'images'}{'section_a'}} = ( [ "image1.gif" , "mark('a',1)" ], [ "image2.gif" , "mark('a',2)" ], ); print( bracket # Put brackets around the row. join ',', # Join the records. map { # For each record, bracket # Put brackets around each record. join ',', # Join the fields. map quote, @$_ # Quote and escape the fields. } @{$_[0]->{'images'}{'section_a'}} ); __END__ output ====== [ [ "image1.gif","mark('a',1)" ],[ "image2.gif","mark('a',2)" ] ]

You may want to use Data::Dumper instead.