AHH thanks I was hoping not to add any dependencies for this and ExtUtils::Command is installed.
I did get path::tiny to work:
#!/usr/bin/perl
package Debug;
use strict ;
use warnings ;
&test_pt;
sub test_ex {
use ExtUtils::Command;
my ( $path ) = @_ ;
my ($file, $count);
my @files = ('test.txt','test-1.txt');
foreach $file (@files) {
if ($path) {$file = "$path/$file"}
$count++;
print "$file\n";
ExtUtils::Command::touch $file || ($count--, print "$file not update
+d\n") ;
}
print "$count files updated\n";
}
sub test_pt {
use Path::Tiny qw/ path /;
my ( $path ) = @_ ;
my ($file, $count);
my @files = ('test.txt','test-1.txt');
foreach $file (@files) {
if ($path) {$file = "$path/$file"}
$count++;
print "$file\n";
path( $file )->touchpath || ($count--, print "$file not updated\n")
+ ;
}
print "$count files updated\n";
}
1;
Oh well not going to be a big deal to add it
Thanks!
|