Create an empty array, then change the contents of the “wanted” subroutine (the anonymous sub) to push the required files onto the array rather than printing them:
#! perl use strict; use warnings; use File::Find; my @filtered = (...); my @files; find(sub { push @files, $File::Find::name if /\.lef$/ } , @filtered); # access @files as needed
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: how to assign output of find() into a variable
by Athanasius
in thread how to assign output of Find() into a variable $
by teddy6507
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |