in reply to problem : return an array list
Dereference:
my @aryref = &retary; print ${$aryref[0]}[0]; #print 1st element of 1st array
I've started return and receiving hashes in my subrou.. ahem, methods, as you now dont have to worry about the order in which you call them..my %hash; $hash{ary1} = @ary1; $hash{ary2} = @ary2; $hash{ary3} = @ary3;
As a slight aside Data::Dumper is invaluable when you get the dereferencing blues with complex data structures:
HTH's!#!/usr/bin/perl -w use strict; use Data::Dumper; my @aoh; $aoh[0] = { key => 'value'}; print Dumper(@aoh);
|
|---|