in reply to Re^5: ExtUtils::Command touch
in thread ExtUtils::Command touch

I did read that I am just learning perl. I am looking for an example for use in a pm file: ExtUtils::Command::touch test.txt Does not work as expected from inside a pm I would expect the following code to create two files in the current directory:
#!/usr/bin/perl package Debug; use strict ; use warnings ; sub test { 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"; } 1;
If I run the command perl -MDebug -e 'Debug::test(".")' it reports no errors and no files are created EDIT oops posted wrong code --fixed

Replies are listed 'Best First'.
Re^7: ExtUtils::Command touch (Shell::Command)
by Anonymous Monk on Jan 13, 2014 at 22:59 UTC