From: Michael G. Schwern Date: Tue, 3 Sep 2002 17:21:57 +0000 (-0700) Subject: File::Basename doesn't lazy load Carp right. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6286f723a70d9d63bf59e611a2946140879179c3;p=p5sagit%2Fp5-mst-13.2.git File::Basename doesn't lazy load Carp right. and Subject: [PATCH] More modules that don't lazy load Carp right. Message-ID: <20020904002157.GD2701@ool-18b93024.dyn.optonline.net> and Message-ID: <20020904003857.GE2701@ool-18b93024.dyn.optonline.net> p4raw-id: //depot/perl@17840 --- diff --git a/ext/Encode/Unicode/Unicode.pm b/ext/Encode/Unicode/Unicode.pm index fa508eb..b09e126 100644 --- a/ext/Encode/Unicode/Unicode.pm +++ b/ext/Encode/Unicode/Unicode.pm @@ -60,7 +60,7 @@ sub set_transcoder{ *encode = \&encode_classic; }else{ require Carp; - Carp::croak __PACKAGE__, "::set_transcoder(modern|classic|xs)"; + Carp::croak(__PACKAGE__, "::set_transcoder(modern|classic|xs)"); } } @@ -258,7 +258,7 @@ sub poisoned2death{ my $msg = shift; my $pair = join(", ", map {sprintf "\\x%x", $_} @_); require Carp; - Carp::croak $obj->name, ":", $msg, "<$pair>.", caller; + Carp::croak($obj->name, ":", $msg, "<$pair>.", caller); } 1; diff --git a/ext/Encode/lib/Encode/Encoding.pm b/ext/Encode/lib/Encode/Encoding.pm index 1876cb7..1d24e9c 100644 --- a/ext/Encode/lib/Encode/Encoding.pm +++ b/ext/Encode/lib/Encode/Encoding.pm @@ -36,14 +36,14 @@ sub encode { require Carp; my $obj = shift; my $class = ref($obj) ? ref($obj) : $obj; - Carp::croak $class, "->encode() not defined!"; + Carp::croak($class, "->encode() not defined!"); } sub decode{ require Carp; my $obj = shift; my $class = ref($obj) ? ref($obj) : $obj; - Carp::croak $class, "->encode() not defined!"; + Carp::croak($class, "->encode() not defined!"); } sub DESTROY {} diff --git a/ext/Sys/Hostname/Hostname.pm b/ext/Sys/Hostname/Hostname.pm index 1efc897..29825b9 100644 --- a/ext/Sys/Hostname/Hostname.pm +++ b/ext/Sys/Hostname/Hostname.pm @@ -47,7 +47,7 @@ sub hostname { # rats! $host = ''; - Carp::croak "Cannot get host name of local machine"; + croak "Cannot get host name of local machine"; } elsif ($^O eq 'MSWin32') { @@ -110,7 +110,7 @@ sub hostname { } # bummer - || Carp::croak "Cannot get host name of local machine"; + || croak "Cannot get host name of local machine"; # remove garbage $host =~ tr/\0\r\n//d; diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index f2ef495..1c9a419 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -169,7 +169,7 @@ sub fileparse { my($fullname,@suffices) = @_; unless (defined $fullname) { require Carp; - Carp::croak "fileparse(): need a valid pathname"; + Carp::croak("fileparse(): need a valid pathname"); } my($fstype,$igncase) = ($Fileparse_fstype, $Fileparse_igncase); my($dirpath,$tail,$suffix,$basename);