#!/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 updated\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;