mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 21:05:42 -04:00
Add seval, wseval, and sweval for strict along with warnings.
This commit is contained in:
parent
29db43d442
commit
c332e3389a
1 changed files with 8 additions and 3 deletions
|
@ -19,7 +19,7 @@ sub new {
|
||||||
$self->{opts} = {
|
$self->{opts} = {
|
||||||
command => 1,
|
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");
|
$self->{dbh} = DBI->connect("dbi:SQLite:dbname=var/evallogs.db");
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -50,14 +50,19 @@ sub command {
|
||||||
'lua' => 'lua',
|
'lua' => 'lua',
|
||||||
'j' => 'j',
|
'j' => 'j',
|
||||||
'w' => 'perl',
|
'w' => 'perl',
|
||||||
|
's' => 'perl',
|
||||||
|
'ws' => 'perl',
|
||||||
|
'sw' => 'perl',
|
||||||
);
|
);
|
||||||
|
|
||||||
$type = $translations{$type};
|
$type = $translations{$type};
|
||||||
if( not $type ) { $type = 'perl'; }
|
if( not $type ) { $type = 'perl'; }
|
||||||
warn "Found $type: $code";
|
warn "Found $type: $code";
|
||||||
|
|
||||||
if ($command eq 'weval') {
|
if ($command =~ /([ws]+)?eval/i) {
|
||||||
$code = "use warnings; ".$code;
|
my $c=$1;
|
||||||
|
$code = "use warnings; ".$code if ($c =~ /w/);
|
||||||
|
$code = "use strict; ".$code if ($c =~ /s/);
|
||||||
}
|
}
|
||||||
|
|
||||||
$code =~ s//\n/g;
|
$code =~ s//\n/g;
|
||||||
|
|
Loading…
Add table
Reference in a new issue