Thanks Martin,
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.


I did that, and then at the bottom of the script I tried looping through just to verify that @files was populated - no dice.

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 && push @files, name;
}

for $element (@files) {
      print $element, "\n";
}



What have I done wrong? Although if I put that for loop within the function it does populate, but it repeats each results 6 times.

Matt

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


Reply via email to