in reply to Getting Specific List Elements Out of an Array Reference
my ( $id, $area, $cpu, $ip, $ip2 ) = @{$IpInfo->[0]};
With what you did, you simply assigned $IpInfo->[0], an array ref to $id. You can prove this by:
use Data::Dumper; use strict; use warnings; my $IpInfo = [ [ '20', '74', '6', '55', '56' ] ]; my ( $id, $area, $cpu, $ip, $ip2 ) = $IpInfo->[0]; print Dumper($id);
Which prints:
$VAR1 = [ '20', '74', '6', '55', '56' ];
And that's what you got earlier when you tried to dump $IpInfo->[0].
|
---|