in reply to Re: retrieve list values...
in thread retrieve list values...

the variable that I'm printing is defined like this : my @tss = $tool->{param}->{'TARGET_SERVICES_SINGLE'}; when I print it I get array reference. the code that you suggested didn't work :-( what am I doing wrong !?

Replies are listed 'Best First'.
Re^3: retrieve list values...
by jdporter (Paladin) on Jul 18, 2005 at 14:14 UTC

    If you did anything wrong, it was to neglect to say that you've got a plain array that you're printing out the variable using Data::Dumper. :-)

    To account for this, simply take the code I posted before and replace @$VAR1 with @tss: :

    for my $rec_hr ( @tss ) { my @rec = @{$rec_hr}{'ID','TEXT','VALUE'}; push @array_records, \@rec; print "(@rec)\n"; }
    I might also suggest that you read up on references, e.g. in perlreftut.