> Did you try it? You are right, the second foreach is totally redundant.
>
> > foreach my $item ( @$cfgs )
> > {
> > foreach my $inner ( $item )
> > {
> > print "$inner->{'dir'} : $inner->{'tpl'} : $inner->{'ext'} :
>$inner->{'rgx'}\n";
> > }
>
> The only effect the second loop has is to rename $item to $inner. Get
> rid of it, and change $inner to $item in your print statement.
And also there is no need to quote hash keys, and if $inner is just a hash reference
then the
following is a shorter replacement:
print join (" : ", $_->{qw<dir tpl ext rgx>}) . "\n" for @$cfgs;
Whilst I'm not implication you *should* use this form, but to be aware it exists. The
main trick
is to use a hash slice, E.g:
($value1, $value2) = $hash{'key1', 'key2'};
is the same as:
($value1, $value2) = ($hash{key1}, $hash{key2});
Naturally I haven't tested, but it should be okay... should... :P
Jonathan Paton
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]