On Thursday 22 Apr 2010 15:03:05 Harry Putnam wrote:
> Thomas Bätzler <[email protected]> writes:
> > Harry Putnam <[email protected]> wrote:
[SNIP]
> I pointed to that exact piece of code then asked how to make that
> kind of options setting when using this format of find()
>
> find(
> sub {
> if(bla){
> blabla
> }
> },
> @dir
> );
>
Not sure if it's possible. Just use the syntax below - it's equivalent. Due to
Perl's argument passing syntax and semantics, you are sometimes unable to use
a function signature to pass extra arguments.
Regards,
Shlomi Fish
> Your proposed code
>
> > find( {
> >
> > wanted => sub {
> >
> > print "$_\n";
> > print "$File::Find::name\n";
> > if ($lastfld eq $_) {
> >
> > print "<$lastfld> matches <$_>; Lets check the size:\n";
> > my $size = (stat($File::Find::name))[7];
> > print "$File::Find::name size: $size\n";
> >
> > }
> >
> > },
> > no_chdir => 1,
> >
> > },
> > $dir2
> >
> > );
>
> doesn't do that.
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
First stop for Perl beginners - http://perl-begin.org/
Deletionists delete Wikipedia articles that they consider lame.
Chuck Norris deletes deletionists whom he considers lame.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/