Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sub make_lists {
my @all_dem_arrays;
#bullshit creation of dynamically named arrays
for(@_){
my @{$_} = qw/1 2 3/; # this is your non-statically named array
push @all_dem_arrays, \@{$_}; # this is you pushing a reference to it
}
return @all_dem_arrays; # this is you returning a list of those reference
}
my @lists = make_lists('blondes', 'brunettes', 'redheads');
# and here you are proving that it worked
foreach my $list ( @lists ){
print join(', ' => @{$list}), "\n";
}
{
my %names;
$names{$array1name} = \@array1;
$names{$array2name} = \@array2;
return map {@{$names{$_}}} keys %names;
# returns all array values as single list
return values %names # returns refs to each array
}