in reply to ExtUtils::Command touch

use Path::Tiny qw/ path /; eval { path( $foo )->touch; 1 } or path( $foo )->touchpath;

use Shell::Command qw/ touch /; touch ( @files );

  • Comment on Re: ExtUtils::Command touch (Path::Tiny , Shell::Command )

Replies are listed 'Best First'.
Re^2: ExtUtils::Command touch (Path::Tiny , Shell::Command )
by aturtle (Novice) on Jan 13, 2014 at 23:24 UTC
    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!