To my view, this behavior of File::Find is going against DWIM and is certainly 
LTA. Anyway, what you you probably is looking for is something like

exclude => { $_ ~~ any(@exclude) }

BTW, the only thing File::Find needs to work with junctions is to declare 
:$exclude as Mu. In this case the call to find will not be auto-threaded.

Best regards,
Vadim Belman

> On May 21, 2021, at 4:41 PM, Joseph Brenner <doom...@gmail.com> wrote:
> 
>> I just gave a few other variants a try-- passing a junction in a
> variable, passing a code block containing a function-- without any
> luck.
> 
> Sorry, I mean a code block containing a *junction* or course.
> 
> Like:
> 
>      my @exclude = ( rx/<|w>mothera$/, rx/<|w>camel$/ );
>      my $any_exclude = any(@exclude);
>      my @files = find( dir => $loc, type => 'file', exclude => {
> $any_exclude } );
>      say @files;
>      # ["/home/doom/tmp/monster_island/godzilla".IO
> "/home/doom/tmp/monster_island/mothera".IO
> "/home/doom/tmp/monster_island/rhodan".IO]
> 
> 
> On 5/21/21, Joseph Brenner <doom...@gmail.com> wrote:
>> Thanks, yes the actual result is certainly consistent with the
>> junction applied at the top level, and not internally, which is what I
>> was expecting.
>> 
>> Is there actually no way to pass a junction in to a function so that
>> it can be used later in an internal smartmach?   That's been my rough
>> impression of what junctions are for, a way to have a compound value
>> that's treated as a single one until it's used.
>> 
>> I just gave a few other variants a try-- passing a junction in a
>> variable, passing a code block containing a function-- without any
>> luck.
>> 
> 

Reply via email to