From c9d93a88ccca072994ead7deaddcc7c01c790853 Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Sat, 1 Apr 2017 15:43:38 -0400 Subject: [PATCH] Add 5.5-5.8 and update help --- lib/eval.pl | 3 +++ plugins/eval.pm | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/eval.pl b/lib/eval.pl index 6afa50d..ba05129 100755 --- a/lib/eval.pl +++ b/lib/eval.pl @@ -407,6 +407,9 @@ Biqsip biqsip 'ugh chan ghitlh lursa' nuh bey' ngun petaq qeng soj tlhej waqboch my ($version, $code) = @_; my %vmap = ( + '5.5' => '/perl5/perlbrew/perls/perl-5.005_04/bin/perl', + '5.6' => '/perl5/perlbrew/perls/perl-5.6.2/bin/perl', + '5.8' => '/perl5/perlbrew/perls/perl-5.8.9/bin/perl', '5.10' => '/perl5/perlbrew/perls/perl-5.10.1/bin/perl', '5.12' => '/perl5/perlbrew/perls/perl-5.12.5/bin/perl', '5.14' => '/perl5/perlbrew/perls/perl-5.14.4/bin/perl', diff --git a/plugins/eval.pm b/plugins/eval.pm index 03307af..15f107a 100644 --- a/plugins/eval.pm +++ b/plugins/eval.pm @@ -11,6 +11,8 @@ use strict; no warnings 'void'; +my @versions = ('', qw(5.5 5.6 5.8 5.10 5.12 5.14 5.16 5.18 5.20 5.22 5.24)); + sub new { my( $class ) = @_; @@ -20,7 +22,6 @@ sub new { command => 1, }; - my @versions = ('', qw(5.10 5.12 5.14 5.16 5.18 5.20 5.22 5.24)); my @perl_aliases = map {("eval$_", "weval$_", "seval$_", "wseval$_", "sweval$_")} @versions; $self->{aliases} = [ qw/jseval jeval phpeval pleval perleval deparse k20eval rbeval pyeval luaeval/, @perl_aliases ]; @@ -40,8 +41,6 @@ sub command { $type =~ s/^\s*(\w+?)?eval(.*)?/$1$2/; warn "Initial type: $type\n"; - - my @versions = ('', qw(5.10 5.12 5.14 5.16 5.18 5.20 5.22 5.24)); my %translations = ( js => 'javascript', perl => 'perl', @@ -114,4 +113,4 @@ sub command { "Bot::BB3::Plugin::Eval"; __DATA__ -The eval plugin. Evaluates various different languages. Syntax, eval: code; also pleval deparse rbeval jseval pyeval phpeval k20eval luaeval jeval. +The eval plugin. Evaluates various different languages. Syntax, eval: code; also pleval deparse. You can use different perl versions by doing eval5.X, e.g. eval5.5: print "$]"; You can also add s or w to the eval to quickly add strict or warnings. sweval: print $foo;