OC-PM: Follow up..

Wilson, Douglas dgwilson at sonomasystems.net
Wed Oct 8 18:13:37 CDT 2003


From: Andrew Sweger [mailto:andrew at sweger.net]

> Any reason not to do it like this?

>  my $rule = File::Find::Rule->new;
>  $rule->or($rule->new
>                 ->directory
>                 ->name('CVS')
>                 ->prune
>                 ->discard,
>            $rule->new);


I guess not, except to save myself a bit of typing
('FFR' vs. '$rule->new' or even 'FFR' vs. '$rule'), and
the fact that I haven't yet needed to use 'new' for this
module (mostly since the module checks to see whether it
needs to call new itself on every method call, so you may
as well let it do the work whenever possible, though the
above is a case where you actually do need a 'new') :-)

-Doug



More information about the Oc-pm mailing list