in reply to Getting Specific List Elements Out of an Array Reference

$IpInfo->[0] is an array reference - a single scalar. You need to dereference it to get a list of its elements.

my ( $id, $area, $cpu, $ip, $ip2 ) = @{$IpInfo->[0]};
Note that array elements and hash values are always single scalars. That will save you confusion.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Getting non-Specific List Elements Out of an Array Reference
by Khatri (Scribe) on Oct 31, 2005 at 06:27 UTC
    what would be done if @{$IpInfo->[0]} contain x number of elements and if we don't know what's x.

      If the dereferenced array were too short, the unspecified variables in the list would be declared but remain undefined. If too long, the extra values would be ignored by the program. That's a good reason to keep arrays arrays.

      After Compline,
      Zaxo