in reply to Re: How do I tighten this with map?
in thread How do I tighten this with map?
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: How do I tighten this with map?
by dragonchild (Archbishop) on Oct 16, 2001 at 21:26 UTC | |
by IraTarball (Monk) on Oct 16, 2001 at 21:47 UTC |