From c332e3389a5f0eedee93af671e5a1ac91eb3d023 Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Thu, 2 Feb 2017 15:09:25 -0500 Subject: [PATCH] Add seval, wseval, and sweval for strict along with warnings. --- plugins/eval.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/eval.pm b/plugins/eval.pm index f08b408..0364f12 100644 --- a/plugins/eval.pm +++ b/plugins/eval.pm @@ -19,7 +19,7 @@ sub new { $self->{opts} = { command => 1, }; - $self->{aliases} = [ qw/jseval jeval phpeval pleval perleval deparse k20eval rbeval pyeval luaeval weval/ ]; + $self->{aliases} = [ qw/jseval jeval phpeval pleval perleval deparse k20eval rbeval pyeval luaeval weval wseval sweval seval/ ]; $self->{dbh} = DBI->connect("dbi:SQLite:dbname=var/evallogs.db"); return $self; @@ -50,14 +50,19 @@ sub command { 'lua' => 'lua', 'j' => 'j', 'w' => 'perl', + 's' => 'perl', + 'ws' => 'perl', + 'sw' => 'perl', ); $type = $translations{$type}; if( not $type ) { $type = 'perl'; } warn "Found $type: $code"; - if ($command eq 'weval') { - $code = "use warnings; ".$code; + if ($command =~ /([ws]+)?eval/i) { + my $c=$1; + $code = "use warnings; ".$code if ($c =~ /w/); + $code = "use strict; ".$code if ($c =~ /s/); } $code =~ s/␤/\n/g;