can someone explain to me why this bit of code works and also if it is legal to code like this:
my @array_rev=(); @{$array_rev[1]}=(1,2,3); print "@{$array_rev[1]}";
This code prints 1 2 3. But I don't understand how the second line can work since the array is uninitialized but @{} expects some valid reference!
Thank you :)In reply to Accessing uninitialized arrays. Black magic by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |