4 ms·
Or just the simple $array_ref->[2][2][1];
by tripa 6y ago
Or just the simple
$array_ref->[2][2][1];
- tyingq 6y agoYes, perhaps I shouldn't have gone with just nested arrays/arrayrefs :) Here's a modified example where it's not as clear how to deref. Like: @IP = ('192.168.1.10','192.168.1.15'); @PORT = ("5000","5002"); @TCP = ("Q931","H225","H245"); %TAGS = (L2 =>"ETHERNET",L3=>"IP",L4=>\@TCP); @PKT = ( \@IP, \@PORT, \%TAGS); $array_ref=\@PKT; print $array_ref->[2]{L4}[0];# this works print $$array_ref[2]{L4}[0]; # this works print $array_ref[2]{L4}[0]; # this doesn't