Help for this page

Select Code to Download


  1. or download this
    my @foo = ([qw(one two)], [qw(three four)], [qw(five six)]);
    # use List::Util 'reduce';
    # oops: my $str = reduce {"[$a,$b]"} map { reduce {"[$a,$b]"} @$_ } @f
    +oo;
    my $str = sprintf "[%s]", join ',', map { sprintf '["%s"]', join '","'
    +, @$_} @foo;
    print "--- $str ---\n";