[Melbourne-pm] (no subject)

wigs@stirfried.org wigs at stirfried.org
Sun Mar 26 20:35:56 PST 2006


On Mon, Mar 27, 2006 at 03:17:39PM +1100, Bradley Dean wrote:
> How do I directly reference a member of a returned array - ie (in broken
> code):
> 
> sub gimme_an_array { return (1,2,3,4,5,6); }
> my $third_member = gimme_an_array()[2];
> 
> Which is invalid syntax, but I cannot work out the correct syntax....

my $third_member = (gimme_an_array())[2];

-- 
Wigs


More information about the Melbourne-pm mailing list