From 0a5546d01ff828d0ecdf3c447db6ebbaa3b83d83 Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Tue, 12 Dec 2017 12:07:21 -0500 Subject: [PATCH] Fix warningss for other perls --- plugins/supereval.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/supereval.pm b/plugins/supereval.pm index 3598093..b387588 100644 --- a/plugins/supereval.pm +++ b/plugins/supereval.pm @@ -122,8 +122,8 @@ sub command { my $c=$1; my $v=$2; my $all = $3; - $code = "use warnings; ".$code if ($c =~ /w/ && ($v>=6 || $all)); - $code = '$^W=1;'.$code if ($c =~ /w/ && ($v < 6 && !$all)); + $code = "use warnings; ".$code if ($c =~ /w/ && ($v>=6 || !defined $v || $all)); + $code = '$^W=1;'.$code if ($c =~ /w/ && (defined $v && $v < 6 && !$all)); $code = "use strict; ".$code if ($c =~ /s/); }