diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-11-15 12:37:11 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-11-15 12:37:11 +0000 |
commit | 749daba8115512bb19567dc4404da035c583c7ab (patch) | |
tree | c276380b7b91ed8f8f0cf0e8a9ea2cf3f817132d /MDK/Common/File.pm | |
parent | 3e374c857eccccc6929f86daea3da51e3dd6f7f1 (diff) | |
download | perl-MDK-Common-749daba8115512bb19567dc4404da035c583c7ab.tar perl-MDK-Common-749daba8115512bb19567dc4404da035c583c7ab.tar.gz perl-MDK-Common-749daba8115512bb19567dc4404da035c583c7ab.tar.bz2 perl-MDK-Common-749daba8115512bb19567dc4404da035c583c7ab.tar.xz perl-MDK-Common-749daba8115512bb19567dc4404da035c583c7ab.zip |
make it perl_checker compliant
Diffstat (limited to 'MDK/Common/File.pm')
-rw-r--r-- | MDK/Common/File.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MDK/Common/File.pm b/MDK/Common/File.pm index d67da06..1bec2f5 100644 --- a/MDK/Common/File.pm +++ b/MDK/Common/File.pm @@ -110,8 +110,8 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK); sub dirname { local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' } sub basename { local $_ = shift; s|/*\s*$||; s|.*/||; $_ } -sub cat_ { local *F; open F, $_[0] or return; my @l = <F>; wantarray ? @l : join '', @l } -sub cat__ { my ($f) = @_; my @l = <$f>; wantarray ? @l : join '', @l } +sub cat_ { local *F; open F, $_[0] or return; my @l = <F>; wantarray() ? @l : join '', @l } +sub cat__ { my ($f) = @_; my @l = <$f>; wantarray() ? @l : join '', @l } sub output { my $f = shift; local *F; open F, ">$f" or die "output in file $f failed: $!\n"; print F foreach @_ } sub append_to_file { my $f = shift; local *F; open F, ">>$f" or die "output in file $f failed: $!\n"; print F foreach @_ } sub output_p { my $f = shift; mkdir_p(dirname($f)); output($f, @_) } @@ -194,7 +194,7 @@ sub all { } sub glob_ { - my ($d, $f) = ($_[0] =~ /\*/) ? (dirname($_[0]), basename($_[0])) : ($_[0], '*'); + my ($d, $f) = $_[0] =~ /\*/ ? (dirname($_[0]), basename($_[0])) : ($_[0], '*'); $d =~ /\*/ and die "glob_: wildcard in directory not handled ($_[0])\n"; ($f = quotemeta $f) =~ s/\\\*/.*/g; |