in reply to dynamically named arrays

It looks like the OP doesn't need to keep track of the individual file names, so although a hash of hashes seems like a natural thing to do, I think a hash of arrays is all that was requested. (And it looks like sch's reply is meant for Perl6 -- those of us still using Perl5 would say $filedate{...}).

Anyway, here's an approach that does what the OP proposed:

push( @{$modtimes{substr($filename,0,2)}, $modtime );
Then it's easy to get the arrays back, one type at a time:
foreach $type ( sort keys %modtimes ) { @times = @{$modtimes{$type}}; # do something with this set of @times... }

Replies are listed 'Best First'.
Re: Re: dynamically named arrays
by sch (Pilgrim) on Oct 21, 2002 at 04:45 UTC

    Indeed, in the original question it doesn't specify that the filename should be stored - just seemed to me that if you were storing the file modification times you might want to know which file they referred to :)

    BTW, thanks for the pointer on the

    $filedata{...}
    got my $ and % mixed up there for a mo.

    But today you took me walking, Through a land that we have lost,
    While our children sit at websites, With no access to the cost