Skip Menu |

This queue is for tickets about the CLI-Dispatch CPAN distribution.

Report information
The Basics
Id: 94315
Status: resolved
Priority: 0/
Queue: CLI-Dispatch

People
Owner: Nobody in particular
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Help dies if . in path
Attached is a test script which when run gives the following error: $ perl tclid Error opendir on 'tclid': Not a directory at /home/dj/.perlbrew/libs/perl-5.18.2@dev/lib/perl5/CLI/Dispatch/Help.pm line 91. if '.' is in Perl's lib path. The error seems to be at line 91 of Help.pm: 86 foreach my $inc ( @INC ) { 87 foreach my $path ( @paths ) { 88 my $dir = path( $inc, $path ); 89 next unless $dir->exists; 90 my $iter = $dir->iterator({recurse => 1}); 91 while (my $file = $iter->()) { 92 next if $file->is_dir; when $inc = '.' and $path = name of script, then $dir is the path to the script and $dir->iterator gets unhappy because $dir isn't a directory. Amending line 89 to 89 next unless $dir->exists && $dir->is_dir; seems to do the trick.
Subject: tclid
Download tclid
application/octet-stream 279b

Message body not shown because it is not plain text.

Applied your fix and shipped 0.19. Thanks! On Mon Mar 31 00:37:17 2014, DJERIUS wrote: Show quoted text
> Attached is a test script which when run gives the following error: > > $ perl tclid > Error opendir on 'tclid': Not a directory at > /home/dj/.perlbrew/libs/perl-5.18.2@dev/lib/perl5/CLI/Dispatch/Help.pm > line 91. > > if '.' is in Perl's lib path. > > The error seems to be at line 91 of Help.pm: > > 86 foreach my $inc ( @INC ) { > 87 foreach my $path ( @paths ) { > 88 my $dir = path( $inc, $path ); > 89 next unless $dir->exists; > 90 my $iter = $dir->iterator({recurse => 1}); > 91 while (my $file = $iter->()) { > 92 next if $file->is_dir; > > when $inc = '.' and $path = name of script, then $dir is the path to > the > script and $dir->iterator gets unhappy because $dir isn't a directory. > > Amending line 89 to > > 89 next unless $dir->exists && $dir->is_dir; > > seems to do the trick.