From a0765f3d8bfd38d11622a3e166dcd74fb377c7c7 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 12 Jul 2015 16:58:33 +0300 Subject: [PATCH] Make module compatible with perl 5.8.9 --- Makefile.PL | 12 ++++++++---- lib/WWW/Offliberty.pm | 2 +- off | 12 ++++++------ t/00-load.t | 2 +- t/50-network.t | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 74979fe..6dbd1dc 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,5 +1,8 @@ use ExtUtils::MakeMaker; -use 5.014000; +use strict; +use warnings; + +my $has_br = $ExtUtils::MakeMaker::VERSION >= 6.5503; WriteMakefile( NAME => 'WWW::Offliberty', @@ -7,15 +10,16 @@ WriteMakefile( ABSTRACT_FROM => 'lib/WWW/Offliberty.pm', AUTHOR => 'Marius Gavrilescu ', EXE_FILES => ['off'], - MIN_PERL_VERSION => '5.14.0', + MIN_PERL_VERSION => '5.8.9', LICENSE => 'perl', - BUILD_REQUIRES => { + (BUILD_REQUIRES => { qw/Test::RequiresInternet 0/, - }, + }) x $has_br, SIGN => 1, PREREQ_PM => { qw/HTML::TreeBuilder 0 HTTP::Tiny 0/, + ('Test::RequiresInternet' => 0) x !$has_br }, META_ADD => { dynamic_config => 0, diff --git a/lib/WWW/Offliberty.pm b/lib/WWW/Offliberty.pm index a8ca576..f89e0d6 100644 --- a/lib/WWW/Offliberty.pm +++ b/lib/WWW/Offliberty.pm @@ -1,6 +1,6 @@ package WWW::Offliberty; -use 5.014; +use 5.008009; use strict; use warnings; use parent qw/Exporter/; diff --git a/off b/off index c0f018e..c4183c0 100755 --- a/off +++ b/off @@ -1,13 +1,13 @@ -#!/usr/bin/perl -w -use v5.14; +#!/usr/bin/perl +use 5.008009; +use strict; +use warnings; use Getopt::Long qw/GetOptions/; use WWW::Offliberty qw/off/; -my %params; -$, = "\n"; -GetOptions ('param=s' => \%params); -say off shift, %params; +GetOptions ('param=s' => \my %params); +print "$_\n" for off shift, %params; __END__ diff --git a/t/00-load.t b/t/00-load.t index f800658..6072a91 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl use strict; use warnings; diff --git a/t/50-network.t b/t/50-network.t index 59e77b1..44d9a98 100644 --- a/t/50-network.t +++ b/t/50-network.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl use strict; use warnings; -- 2.39.2