diff options
author | Michael G. Schwern <schwern@pobox.com> | 2002-05-17 13:17:54 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-17 21:35:45 +0000 |
commit | 57b1a898feef90fc19df54256136c678f3487b9a (patch) | |
tree | eb4a34df55a9efa72471dfd3553566dbe03c8bf9 /lib/ExtUtils/Command.pm | |
parent | 72699b0f2772b6d9c4affdf9e0a3a501db463332 (diff) | |
download | perl-57b1a898feef90fc19df54256136c678f3487b9a.tar.gz |
ExtUtils::MakeMaker 5.92_01 -> 5.94_02
Message-ID: <20020517211754.GK13131@ool-18b93024.dyn.optonline.net>
p4raw-id: //depot/perl@16663
Diffstat (limited to 'lib/ExtUtils/Command.pm')
-rw-r--r-- | lib/ExtUtils/Command.pm | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/ExtUtils/Command.pm b/lib/ExtUtils/Command.pm index 4b998b21f9..ac83415354 100644 --- a/lib/ExtUtils/Command.pm +++ b/lib/ExtUtils/Command.pm @@ -1,15 +1,14 @@ package ExtUtils::Command; -use 5.006; +use 5.00503; use strict; -# use AutoLoader; use Carp; use File::Copy; use File::Compare; use File::Basename; use File::Path qw(rmtree); require Exporter; -our(@ISA, @EXPORT, $VERSION); +use vars qw(@ISA @EXPORT $VERSION); @ISA = qw(Exporter); @EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f); $VERSION = '1.03_01'; @@ -33,7 +32,17 @@ ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc. =head1 DESCRIPTION -The module is used to replace common UNIX commands. +The module is used to replace common UNIX commands. In all cases the +functions work from @ARGV rather than taking arguments. This makes +them easier to deal with in Makefiles. + + perl -MExtUtils::Command -e some_command some files to work on + +I<NOT> + + perl -MExtUtils::Command -e 'some_command qw(some files to work on)' + +Filenames with * and ? will be glob expanded. =over 4 @@ -78,7 +87,8 @@ Removes directories - recursively (even if readonly) sub rm_rf { - rmtree([grep -e $_,expand_wildcards()],0,0); + expand_wildcards(); + rmtree([grep -e $_,@ARGV],0,0); } =item rm_f files.... @@ -89,7 +99,8 @@ Removes files (even if readonly) sub rm_f { - foreach (expand_wildcards()) + expand_wildcards(); + foreach (@ARGV) { next unless -f $_; next if unlink($_); @@ -165,7 +176,8 @@ Sets UNIX like permissions 'mode' on all the files. sub chmod { my $mode = shift(@ARGV); - chmod($mode,expand_wildcards()) || die "Cannot chmod ".join(' ',$mode,@ARGV).":$!"; + expand_wildcards(); + chmod($mode,@ARGV) || die "Cannot chmod ".join(' ',$mode,@ARGV).":$!"; } =item mkpath directory... @@ -176,7 +188,8 @@ Creates directory, including any parent directories. sub mkpath { - File::Path::mkpath([expand_wildcards()],0,0777); + expand_wildcards(); + File::Path::mkpath([@ARGV],0,0777); } =item test_f file |