Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/cpan2dist
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ $cb->reload_indices() if $opts->{'flushcache'};

for my $name ( keys %$href ) {
my $obj = $cb->parse_module( module => $name ) or (
warn "Cannot make a module object out of ".
"'$name' -- skipping\n",
warn("Cannot make a module object out of ".
"'$name' -- skipping\n"),
next );

if( my $pat = ignore_me( $obj ) ) {
Expand Down
1 change: 0 additions & 1 deletion inc/bundle/IO/Zlib.pm
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ sub gzopen_external {
} else {
croak "IO::Zlib::gzopen_external: mode '$mode' is illegal";
}
return undef;
}

sub gzread_external {
Expand Down
3 changes: 1 addition & 2 deletions inc/bundle/Module/Load.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ sub _load{
$import = $mod->can('import')
) and (
unshift(@_, $mod),
goto &$import,
return
goto &$import
)
);
}
Expand Down
5 changes: 2 additions & 3 deletions lib/CPANPLUS/Configure.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ or not. Defaults to C<true>.
};

check( $tmpl, \%hash ) or (
warn Params::Check->last_error, return
warn(Params::Check->last_error), return
);

$Config ||= CPANPLUS::Config->new;
Expand Down Expand Up @@ -150,7 +150,7 @@ Returns true on success, false on failure.
};

check( $tmpl, \%hash ) or (
warn Params::Check->last_error, return
warn(Params::Check->last_error), return
);

### if the base dir is changed, we have to rescan it
Expand Down Expand Up @@ -449,7 +449,6 @@ sub options {
return sort grep { !$seen{$_}++ }
map { $_->$type->ls_accessors if $_->can($type) }
$self->conf;
return;
}

=pod
Expand Down
2 changes: 0 additions & 2 deletions lib/CPANPLUS/Configure/Setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ Quitting setup, changes are saved to '%1'
### otherwise, present choice again
redo PICK_SECTION;
}

return 1;
}


Expand Down
80 changes: 0 additions & 80 deletions lib/CPANPLUS/Internals/Source.pm
Original file line number Diff line number Diff line change
Expand Up @@ -825,86 +825,6 @@ sub __create_dslip_tree {
my $conf = $self->configure_object;

return {}; # Quick hack

my $tmpl = {
path => { default => $conf->get_conf('base') },
verbose => { default => $conf->get_conf('verbose') },
uptodate => { default => 0 },
};

my $args = check( $tmpl, \%hash ) or return;

### get the file name of the source ###
my $file = File::Spec->catfile($args->{path}, $conf->_get_source('dslip'));

### extract the file ###
my $ae = Archive::Extract->new( archive => $file ) or return;
my $out = STRIP_GZ_SUFFIX->($file);

### make sure to set the PREFER_BIN flag if desired ###
{ local $Archive::Extract::PREFER_BIN = $conf->get_conf('prefer_bin');
$ae->extract( to => $out ) or return;
}

my $in = $self->_get_file_contents( file => $out ) or return;

### don't need it anymore ###
unlink $out;


### get rid of the comments and the code ###
### need a smarter parser, some people have this in their dslip info:
# [
# 'Statistics::LTU',
# 'R',
# 'd',
# 'p',
# 'O',
# '?',
# 'Implements Linear Threshold Units',
# ...skipping...
# "\x{c4}dd \x{fc}ml\x{e4}\x{fc}ts t\x{f6} \x{eb}v\x{eb}r\x{ff}th\x{ef}ng!",
# 'BENNIE',
# '11'
# ],
### also, older versions say:
### $cols = [....]
### and newer versions say:
### $CPANPLUS::Modulelist::cols = [...]
### split '$cols' and '$data' into 2 variables ###
### use this regex to make sure dslips with ';' in them don't cause
### parser errors
my ($ds_one, $ds_two) = ($in =~ m|.+}\s+
(\$(?:CPAN::Modulelist::)?cols.*?)
(\$(?:CPAN::Modulelist::)?data.*)
|sx);

### eval them into existence ###
### still not too fond of this solution - kane ###
my ($cols, $data);
{ #local $@; can't use this, it's buggy -kane

$cols = eval $ds_one;
error( loc("Error in eval of dslip source files: %1", $@) ) if $@;

$data = eval $ds_two;
error( loc("Error in eval of dslip source files: %1", $@) ) if $@;

}

my $tree = {};
my $primary = "modid";

### this comes from CPAN::Modulelist
### which is in 03modlist.data.gz
for (@$data){
my %hash;
@hash{@$cols} = @$_;
$tree->{$hash{$primary}} = \%hash;
}

return $tree;

} #__create_dslip_tree

=pod
Expand Down
2 changes: 1 addition & 1 deletion lib/CPANPLUS/Shell/Default.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ sub _print {
my $old; my $fh;
if( $file ) {
$fh = FileHandle->new( ">$file" )
or( warn loc("Could not open '%1': '%2'", $file, $!),
or( warn(loc("Could not open '%1': '%2'", $file, $!)),
return
);
$old = select $fh;
Expand Down
15 changes: 15 additions & 0 deletions test.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use strict;
use warnings FATAL => 'all';
use v5.10;

sub some{
goto SOME;

my $var;

SOME:
$var = 1;
say $var;
}

some();