in reply to Re^3: Optimal way to read in pipe delimited files
in thread Optimal way to read in pipe delimited files
Because my gives you a new variable each time through the loop, you can use \@a and all it well because it's a different @a each time. When you don't use my within the loop, it's always the same variable. Thus @a = (1,2,3); $a = \@a; @a =(4,3,9); $b = \@a; will cause $a and $b to both reference the same memory location which will contain the values (4,3,9). [@a] makes a copy of @a and returns a reference to it, so you get a new chunk of memory each time.
|
|---|