Procházet zdrojové kódy

dselect: Stop using 'use vars' in method scripts

This also fixes a typo ($VAL1 → $VAR1), and adds %config to the
Dselect::Ftp module exported variables.
Guillem Jover před 13 roky
rodič
revize
48c226fc78

+ 4 - 4
dselect/methods/Dselect/Ftp.pm

@@ -20,10 +20,9 @@ use warnings;
 
 use Exporter qw(import);
 
-use vars qw(@EXPORT %config $VAR1);
-
-@EXPORT = qw(yesno do_connect do_mdtm add_site edit_site
-             edit_config read_config store_config view_mirrors nb);
+our @EXPORT = qw(%config yesno do_connect do_mdtm add_site edit_site
+                 edit_config read_config store_config view_mirrors nb);
+our %config;
 
 sub nb {
   my $nb = shift;
@@ -46,6 +45,7 @@ sub read_config {
   $code = <VARS>;
   close VARS;
 
+  my $VAR1;
   $conf = eval $code;
   die "Couldn't eval $vars content : $@\n" if ($@);
   if (ref($conf) =~ /HASH/) {

+ 1 - 3
dselect/methods/ftp/install

@@ -19,8 +19,6 @@
 use strict;
 use warnings;
 
-use vars qw(%config $ftp);
-
 eval q{
     use Net::FTP;
     use File::Path;
@@ -67,7 +65,7 @@ if (-f "$methdir/md5sums") {
     die "Couldn't read file $methdir/md5sums";
   my $code = <MD5SUMS>;
   close MD5SUMS;
-  use vars qw($VAL1);
+  my $VAR1;
   my $res = eval $code;
   if ($@) {
     die "Couldn't eval $methdir/md5sums content: $@\n";

+ 0 - 2
dselect/methods/ftp/setup

@@ -19,8 +19,6 @@
 use strict;
 use warnings;
 
-use vars qw(%config);
-
 eval 'use Net::FTP;';
 if ($@) {
     print STDERR "Please install the 'perl' package if you want to use the\n" .