I also took the liberty of adding a '\' before the '.' in your regex. It looked like you meant a literal '.' not 'any character'. I think dragonchild's is more easily understood but I like this one.opendir(DIR, $directory) or die $!; my %fileHash = map { (/^(\w{3}\d*):log\.$date$/ => $_); } grep /^\w{3}\d*:log\.$date$/, readdir(DIR); closedir DIR;
UPDATE: Even though this works and is all true, look a little lower to japhy's. It's better.
Ira,
"So... What do all these little arrows mean?"
~unknown
In reply to Re: Re: How do I tighten this with map?
by IraTarball
in thread How do I tighten this with map?
by SparkeyG
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |