"Zachary Buckholz" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I understand how to use a foreach on a reference to an array as follows: > > my $avg_resp_time = get_avg_resp_time($durations, $url_id); > foreach my $avg_resp(@$avg_resp_time) { > print "AVG = $avg_resp\n"; > } > > But how do I directly access one array value from the reference to the > array? > > print "DEBUG TEST @$avg_resp_time[0]\n"; Fails > print "DEBUG TEST @$avg_resp_time->[0]\n"; Fails > print "DEBUG TEST @{$avg_resp_time[0]}\n"; Fails
Hello Zack, I think what you are looking for is: $avg_resp_time->[0] if you want to have the '@' at the front, I think you would need something like this: @{$avg_resp_time}[0] Shawn [snip] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]