From: Tim Marx Date: Thu, 15 Nov 2018 08:47:41 +0000 (+0100) Subject: fix #1548: replace perl use vars with our X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=0681aa71573c756ac8d7912e6d8c923864d77acf fix #1548: replace perl use vars with our replace deprecated 'use vars qw($frob @mung %seen);' with the now in favor 'our $foo;' declaration see NOTE at: http://perldoc.perl.org/vars.html Signed-off-by: Tim Marx --- diff --git a/src/PVE/AtomicFile.pm b/src/PVE/AtomicFile.pm index b1889e8..2086c7a 100644 --- a/src/PVE/AtomicFile.pm +++ b/src/PVE/AtomicFile.pm @@ -3,9 +3,8 @@ package PVE::AtomicFile; use strict; use warnings; use IO::AtomicFile; -use vars qw(@ISA); -@ISA = qw(IO::AtomicFile); +our @ISA = qw(IO::AtomicFile); sub new { my $class = shift; diff --git a/src/PVE/Exception.pm b/src/PVE/Exception.pm index fa6b73a..29fd94a 100644 --- a/src/PVE/Exception.pm +++ b/src/PVE/Exception.pm @@ -6,12 +6,9 @@ package PVE::Exception; use strict; use warnings; -use vars qw(@ISA @EXPORT_OK); -require Exporter; use Storable qw(dclone); use HTTP::Status qw(:constants); -@ISA = qw(Exporter); use overload '""' => sub {local $@; shift->stringify}; use overload 'cmp' => sub { @@ -20,7 +17,8 @@ use overload 'cmp' => sub { return "$a" cmp "$b"; # compare as string }; -@EXPORT_OK = qw(raise raise_param_exc raise_perm_exc); +use base 'Exporter'; +our @EXPORT_OK = qw(raise raise_param_exc raise_perm_exc); sub new { my ($class, $msg, %param) = @_; diff --git a/src/PVE/SafeSyslog.pm b/src/PVE/SafeSyslog.pm index 63b37f8..c61e97a 100644 --- a/src/PVE/SafeSyslog.pm +++ b/src/PVE/SafeSyslog.pm @@ -5,16 +5,12 @@ use warnings; use File::Basename; use Sys::Syslog (); use Encode; +use base 'Exporter'; -use vars qw($VERSION @ISA @EXPORT); +our $VERSION = '1.00'; -$VERSION = '1.00'; -require Exporter; - -@ISA = qw(Exporter); - -@EXPORT = qw(syslog initlog); +our @EXPORT = qw(syslog initlog); my $log_tag = "unknown";