use warnings;
use strict;
use Path::Class 'dir';
use IPC::Run3 'run3';
use Data::Dump;
my $dir = dir("C:\\Temp\\testuni");
$dir->recurse( callback => sub {
my $path = shift;
if (!$path->is_dir) {
run3 ['hex', $path], undef, \my $out;
dd "$path", $out;
}
});
Don't use dir to get a list of filenames, which is why I'm using Path::Class (at the very least, use readdir). Please show a runnable, representative SSCCE that demonstrates the problem you're having, including sample input (directory structure), expected output for that input, and the actual output you're getting including any error messages.
And by representative I also mean to please show the actual command you're running, assuming it isn't robocopy - since its /l option means to just list files, I'm not sure what you're doing with that command in your sample code. One of the things discussed in The problem of "the" default shell, which is linked from my node referenced above, is that a common mistake is to shell out to commands that should be implemented in native Perl. |