From c36f332e32c91a66401b1b2a5005fff8168212df Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 1 Oct 2013 13:19:38 +0200 Subject: [PATCH] use warnings everywhere. --- data/PVE/AtomicFile.pm | 1 + data/PVE/Exception.pm | 5 ++--- data/PVE/INotify.pm | 2 ++ data/PVE/JSONSchema.pm | 2 +- data/PVE/Network.pm | 1 + data/PVE/PodParser.pm | 1 + data/PVE/ProcFSTools.pm | 1 + data/PVE/RESTHandler.pm | 1 - data/PVE/Tools.pm | 1 + 9 files changed, 10 insertions(+), 5 deletions(-) diff --git a/data/PVE/AtomicFile.pm b/data/PVE/AtomicFile.pm index 2d3426b..110a8ae 100644 --- a/data/PVE/AtomicFile.pm +++ b/data/PVE/AtomicFile.pm @@ -1,6 +1,7 @@ package PVE::AtomicFile; use strict; +use warnings; use IO::AtomicFile; use vars qw(@ISA); diff --git a/data/PVE/Exception.pm b/data/PVE/Exception.pm index 63b3843..fa6b73a 100644 --- a/data/PVE/Exception.pm +++ b/data/PVE/Exception.pm @@ -1,12 +1,11 @@ -#!/usr/bin/perl -w +package PVE::Exception; # a way to add more information to exceptions (see man perlfunc (die)) # use PVE::Exception qw(raise); # raise ("my error message", code => 400, errors => { param1 => "err1", ...} ); -package PVE::Exception; - use strict; +use warnings; use vars qw(@ISA @EXPORT_OK); require Exporter; use Storable qw(dclone); diff --git a/data/PVE/INotify.pm b/data/PVE/INotify.pm index 0f04dd2..5b17433 100644 --- a/data/PVE/INotify.pm +++ b/data/PVE/INotify.pm @@ -3,6 +3,8 @@ package PVE::INotify; # todo: maybe we do not need update_file() ? use strict; +use warnings; + use POSIX; use IO::File; use IO::Dir; diff --git a/data/PVE/JSONSchema.pm b/data/PVE/JSONSchema.pm index 6866f18..bb00c69 100644 --- a/data/PVE/JSONSchema.pm +++ b/data/PVE/JSONSchema.pm @@ -1,7 +1,7 @@ package PVE::JSONSchema; -use warnings; use strict; +use warnings; use Storable; # for dclone use Getopt::Long; use Devel::Cycle -quiet; # todo: remove? diff --git a/data/PVE/Network.pm b/data/PVE/Network.pm index 1fa1dc7..1b755c0 100644 --- a/data/PVE/Network.pm +++ b/data/PVE/Network.pm @@ -1,6 +1,7 @@ package PVE::Network; use strict; +use warnings; use PVE::Tools qw(run_command); use PVE::ProcFSTools; use PVE::INotify; diff --git a/data/PVE/PodParser.pm b/data/PVE/PodParser.pm index d3cbb60..7e31e19 100644 --- a/data/PVE/PodParser.pm +++ b/data/PVE/PodParser.pm @@ -1,6 +1,7 @@ package PVE::PodParser; use strict; +use warnings; use Pod::Parser; use base qw(Pod::Parser); diff --git a/data/PVE/ProcFSTools.pm b/data/PVE/ProcFSTools.pm index 2c2b376..79d8cfd 100644 --- a/data/PVE/ProcFSTools.pm +++ b/data/PVE/ProcFSTools.pm @@ -1,6 +1,7 @@ package PVE::ProcFSTools; use strict; +use warnings; use POSIX; use Time::HiRes qw (gettimeofday); use IO::File; diff --git a/data/PVE/RESTHandler.pm b/data/PVE/RESTHandler.pm index 7157847..08c1015 100644 --- a/data/PVE/RESTHandler.pm +++ b/data/PVE/RESTHandler.pm @@ -2,7 +2,6 @@ package PVE::RESTHandler; use strict; no strict 'refs'; # our autoload requires this - use warnings; use PVE::SafeSyslog; use PVE::Exception qw(raise raise_param_exc); diff --git a/data/PVE/Tools.pm b/data/PVE/Tools.pm index 0ec74d8..fd3c056 100644 --- a/data/PVE/Tools.pm +++ b/data/PVE/Tools.pm @@ -1,6 +1,7 @@ package PVE::Tools; use strict; +use warnings; use POSIX qw(EINTR); use IO::Socket::INET; use IO::Select; -- 2.39.2