in reply to Re^4: Data Structures
in thread Data Structures
Without @{ .. } to derefernce the anonymous array reference, $x would be set to that array reference and $y & $z would be undef.
$line[ 1 ][ 2 ] = [ 3,4,5 ];; my( $x, $y, $z ) = $line[ 1 ][ 2 ];; print for $x, $y, $z;; ARRAY(0x194a9f8) Use of uninitialized value in print at ... Use of uninitialized value in print at ...
With the dereference:
my( $x, $y, $z ) = @{ $line[ 1 ][ 2 ] };; print for $x, $y, $z;; 3 4 5
|
---|