in reply to Re^2: stat function used with linux find gives me no data
in thread stat function used with linux find gives me no data

Well done for consulting the docs - they really are rather good.

You might also want to know that a simple assignment can be chomped as well so you could write this as chomp ($output = $_); instead. Full demo script:

#!/usr/bin/env perl use strict; use warnings; $_ = "foo\n"; print "in: '$_'\n"; chomp (my $output = $_); print "out: '$output'\n";

I concur with others in warning against shelling out to find for your original task, not least because of the vagaries of the arguments and output formats of such a utility across platforms. Stick with the modules which come with Perl or are on CPAN for better portability.


🦛