in reply to How to write the perl script for the following linux command?
Hi,
See File::Find::Rule::Procedural and Path::Tiny
Write something like
use File::Find::Rule 'find'; my @files = find( -name => '*.csv', -in => $sourcedir ); for my $infile ( @files ){ my( $rel ) = path( $infile )->relative( $sourcedir ); my $outfile = path( $targetdir, $rel ); $outfile->touchpath; path($infile)->copy( $outfile ); }
|
|---|