in reply to send $Hash{$array[%Hash]} using Frontier Question.

( # this is [0], a hash ref [...] ),

No, it isn't a hash ref, it's a list. You should use braces { ... } not parentheses to create a hashref:

my $data = extract(); print $data->{content}->[0]->{A}->[1]; sub extract { my %data = ( site_name => "site name", content => [ # array ref { # this is [0], a hash ref handicap => [ 0, "asia", "BigSmall" ], A => [ "name", "asia_score", "BigSmall_score" ], B => [ "name", "asia_score", "BigSmall_score" ], }, { # this is [1] handicap => [ 0, "asia", "BigSmall" ], A => [ "name", "asia_score", "BigSmall_score" ], B => [ "name", "asia_score", "BigSmall_score" ], }, ], ); return \%data; }

Output:

asia_score

Replies are listed 'Best First'.
Re^2: send $Hash{$array[%Hash]} using Frontier Question.
by BlueT (Sexton) on Aug 01, 2007 at 11:37 UTC
    Ooops, it works well after correcting the uncarely () to {}!
    thanx so much! :D
    / BlueT = Matthew / / BlueT@BlueT.org / / Just be Perl Hacking! /