Skip Menu |

This queue is for tickets about the Getopt-Compact CPAN distribution.

Report information
The Basics
Id: 18275
Status: resolved
Worked: 5 min
Priority: 0/
Queue: Getopt-Compact

People
Owner: asw [...] cpan.org
Requestors: cpan [...] clotho.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.02
Fixed in: 0.03



Subject: Use cross-platform basename
The $self->{cmd} is constructed by s|.*/|| which is Unix-specifix. A better solution is to use File::Basename which has been in core Perl since 5.000. Below is a patch that implements that change. -- Chris diff -ur Getopt-Compact-0.02-orig/lib/Getopt/Compact.pm Getopt-Compact-0.02/lib/Getopt/Compact.pm --- Getopt-Compact-0.02-orig/lib/Getopt/Compact.pm 2004-09-24 01:19:00.000000000 -0500 +++ Getopt-Compact-0.02/lib/Getopt/Compact.pm 2006-03-21 15:12:57.000000000 -0600 @@ -278,7 +278,8 @@ $self->{usage} = 1 unless exists $self->{usage}; unless($self->{cmd}) { $self->{cmd} = $0 || ''; - $self->{cmd} =~ s|^.*/||; + require File::Basename; + $self->{cmd} = File::Basename::basename($self->{cmd}); } # add mode options
patch applied