C
cmic
Hello
Instead of mixing shell scripts and Perl, I prefer to do all the job
of the command find (recursion) and other piped commands with Perl.
However, the snippet below doesn't print any file under the current
directory.
The commented line (print "Result...) give the right information, if
uncommented, of \
course.
Any hint ? What do I
miss ,
--
michel marcon aka
cmic
Sysadmin.
#!/usr/local/bin/
perl
use
strict;
use
warnings;
use
File::Find;
find(\&wanted,
".");
sub wanted
{
my $file=
$File::Find::name;
# print "Result $file,
"\n";
if (-f $file )
{
print $file,
"\n";
}
}
Instead of mixing shell scripts and Perl, I prefer to do all the job
of the command find (recursion) and other piped commands with Perl.
However, the snippet below doesn't print any file under the current
directory.
The commented line (print "Result...) give the right information, if
uncommented, of \
course.
Any hint ? What do I
miss ,
--
michel marcon aka
cmic
Sysadmin.
#!/usr/local/bin/
perl
use
strict;
use
warnings;
use
File::Find;
find(\&wanted,
".");
sub wanted
{
my $file=
$File::Find::name;
# print "Result $file,
"\n";
if (-f $file )
{
print $file,
"\n";
}
}