in reply to Passing Array of Arrays
and you should use following:$filesanddates[$filecounter] = \@fileanddate;
instead of$logfilename = $filesanddates->[$listcount][0];
But I would like to offer you another way:$filesanddates[$filecounter] = \@fileanddate;
!/usr/bin/perl -w use strict; # You can use this module for dumping your data. use Data::Dumper; # Function which forms an files array sub one { my $dir = shift; # Dir name opendir(DIR, $dir) or die "Can't open $dir: $!"; my @files = grep { !(/^\./) && /^post/ && -f } readdir(DIR); closedir(DIR); my $res; # Array reference which will consist results @$res = map { [$_, (stat($_))[9]] } @files; return $res; } # Function which processes result array sub two { my $array = shift; for(@$array) { print $_->[0] .': '.$_->[1]."\n"; <do something> ... } } # Call our functions two(one('/var/logs'));
========================
{ firstname => 'Michael',
quote => 'Mice were crying and stinging but went on nibbling the cactus', }
|
|---|