Gentoo Archives: gentoo-perl

From: antoine.raillon@××××××.net
To: gentoo-perl@l.g.o
Subject: [gentoo-perl] r14 - code
Date: Thu, 12 May 2005 21:57:25
Message-Id: 20050512215630.AFEDD8280EF@gredin.dragou.net
Author: mcummings
Date: 2005-05-11 16:44:08 +0200 (Wed, 11 May 2005)
New Revision: 14

Modified:
   code/g-cpan.pl
Log:
Got rid of the regex cost and resorted to basename for prog

Modified: code/g-cpan.pl
===================================================================
--- code/g-cpan.pl	2005-05-11 13:59:01 UTC (rev 13)
+++ code/g-cpan.pl	2005-05-11 14:44:08 UTC (rev 14)
@@ -10,6 +10,7 @@
 use diagnostics;
 use File::Spec;
 use File::Path;
+use File::Basename;
 
 use constant MAKE_CONF         => '/etc/make.conf';
 use constant PATH_PKG_DEV_PERL => '/var/db/pkg/dev-perl';
@@ -41,8 +42,7 @@
 # predeclared subs
 sub printbig;
 
-my $prog = $0;
-$prog =~ s|^.*/||;
+my $prog = basename($0);
 
 # Do we need to generate a config ?
 eval 'use CPAN::Config;';


-- 
gentoo-perl@g.o mailing list