Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
       $arr[0]->[0] = "xyz"; $arr[0]->[1] = "123";
       for my $e (@arr) { print "Case 2 after: $e: $e->[0] $e->[1]\n" }
    }
    
  2. or download this
    Case 1 before: ARRAY(0x61ddc8): abc def
    Case 1 before: ARRAY(0x61ddc8): abc def
    ...
    Case 2 after: ARRAY(0x61de28): xyz 123
    Case 2 after: ARRAY(0x315918): abc def
    Case 2 after: ARRAY(0x315990): abc def
    
  3. or download this
    my @arr = ( [@list] ) x $nelts;
    
  4. or download this
    my @arr = map { [@list] } 1 .. $nelts;