BackupPC Has qw(…) Warnings Since Upgrading Perl

Posted by Paul Farrow - Under: Linux, Software

So since upgrading Perl I am presented with qw warnings coming out of the cron job checking that BackupPC is running.

Use of qw(...) as parentheses is deprecated at /usr/share/BackupPC/lib/BackupPC/Storage/Text.pm line 301.
Use of qw(...) as parentheses is deprecated at /usr/share/BackupPC/lib/BackupPC/Lib.pm line 1412.

The way to get rid of these warnings is to enclose qw in parentheses and Perl processes the foreach parameters without warnings.

Like so

Text.pm (Line 301)

#
# Promote BackupFilesOnly and BackupFilesExclude to hashes
#
foreach my $param (qw(BackupFilesOnly BackupFilesExclude)) {
next if ( !defined($conf->{$param}) || ref($conf->{$param}) eq "HASH" );
$conf->{$param} = [ $conf->{$param} ]
if ( ref($conf->{$param}) ne "ARRAY" );
$conf->{$param} = { "*" => $conf->{$param} };
}

Lib.pm (Line 1412)

foreach my $param (qw(BackupFilesOnly BackupFilesExclude)) {
next if ( !defined($conf->{$param}) );
if ( ref($conf->{$param}) eq "HASH" ) {

Tags: , , ,