Hi,

change following line:
>     (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && 
> /^DATA.*\.zip\z/s && print("$name\n");

to

>     (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && 
> /^DATA.*\.zip\z/s && push @files, $name;

at the end you have all files in the @files array.

HTH
Martin

On Tue, 19 Jun 2007 06:34:33 -0600
Matt <[EMAIL PROTECTED]> wrote:

> Using the find2perl utility how would I send the output to an array?  By 
> default it will print out the results like:
> 
> /home/ftpuser/aef/flexvault/EOM033107/DATAAG.zip
> /home/ftpuser/aef/flexvault/EOM033107/DATAHZ.zip
> 
> 
> I'd like those lines to be put into an array instead of printed to 
> stdout.  I tried setting a variable instead of using print - but of 
> course I'm missing something.
> 
> #!/usr/bin/perl
> 
> use File::Find;
> 
> $cuid = "aef";
> $directory = "EOM033107";
> 
> use vars qw/*name *dir *prune/;
> *name   = *File::Find::name;
> *dir    = *File::Find::dir;
> *prune  = *File::Find::prune;
> 
> sub wanted;
> 
> $smallcuid = lc $cuid;
> 
> # Traverse desired filesystems
> File::Find::find({wanted => \&wanted}, 
> '/home/ftpuser/'.$smallcuid.'/flexvault/'.$directory.'/');
> exit;
> 
> 
> sub wanted {
>     my ($dev,$ino,$mode,$nlink,$uid,$gid);
> 
>     (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && 
> /^DATA.*\.zip\z/s && print("$name\n");
>  
> }
> 
> 
> 
> Any help would be appreciated.
> 
> Matt
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to