From: Craig A. Berry Date: Fri, 7 Sep 2001 15:30:03 +0000 (-0500) Subject: slash slashes in lib/CGI/Carp.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f16a916e38092766fa8e01dc13187d7e1f1362c;p=p5sagit%2Fp5-mst-13.2.git slash slashes in lib/CGI/Carp.pm Message-Id: <5.1.0.14.0.20010907142644.03700c38@exchi01> p4raw-id: //depot/perl@11943 --- diff --git a/lib/CGI/Carp.pm b/lib/CGI/Carp.pm index 3af2e9f..2829e22 100644 --- a/lib/CGI/Carp.pm +++ b/lib/CGI/Carp.pm @@ -218,6 +218,7 @@ CGI::Response require 5.000; use Exporter; use Carp; +use File::Spec; @ISA = qw(Exporter); @EXPORT = qw(confess croak carp); @@ -248,19 +249,19 @@ sub realdie { CORE::die(@_); } sub id { my $level = shift; my($pack,$file,$line,$sub) = caller($level); - my($id) = $file=~m|([^/]+)$|; + my($dev,$dirs,$id) = File::Spec->splitpath($file); return ($file,$line,$id); } sub stamp { my $time = scalar(localtime); my $frame = 0; - my ($id,$pack,$file); + my ($id,$pack,$file,$dev,$dirs); do { $id = $file; ($pack,$file) = caller($frame++); } until !$file; - ($id) = $id=~m|([^/]+)$|; + ($dev,$dirs,$id) = File::Spec->splitpath($id); return "[$time] $id: "; }