perl script help

Hello Experts:

I am looking for multi-threaded script to parse through the NAS folders and subfolders .. and get checksum values of all files

Sample output
Path, File, checksumvalue

Using this script - doesn't work

use File::Find;

find(sub {return unless -f $File::Find::name; system("cksum $File::Find::name");}, '/directory1')

Open in new window

please assist ...

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Personally, I'd do it this way...  This is just using File::Find directly - if it does not perform well enough, we can add in forking to search multiple places at once...

use strict;
use warnings;
use File::Find ();
use Cwd ();

# for the convenience of &wanted calls, including -eval statements:
use vars qw/*name *dir *prune/;
*name   = *File::Find::name;
*dir    = *File::Find::dir;

my $cwd = Cwd::cwd();

# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '/directory1');

sub wanted {
    return unless (-f $_);
    my $cksum = `cksum $name`;
    $cksum =~ s{^\s+}{};
    $cksum =~ s{\s+.*$}{};
    print "$dir,$_,$cksum\n";

Open in new window

I think your original script would work (at least produce cksum output for each file) if you switch $File::Find::name to $_.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
In what sense is that multi-threaded?
It's not.  I figured we'd start with something simple that worked and then move to multi-thread/process.  If the OP is happy with what I provided then that's fine with me.
CalmSoulAuthor Commented:
I am just happy somebody replied
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.