Revision: | 1.4 |
Committed: | Thu Aug 3 11:23:58 2006 UTC (17 years, 9 months ago) by root |
Branch: | MAIN |
Changes since 1.3: | +7 -13 lines |
Log Message: | *** empty log message *** |
# | Content |
---|---|
1 | #! perl |
2 | |
3 | use Storable qw/nfreeze thaw/; |
4 | |
5 | my %global; # for use by eval'ed commands |
6 | |
7 | cf::register_extcmd perl_eval => sub { |
8 | my ($pl, $msg) = @_; |
9 | |
10 | return (error => "error permission denied") |
11 | unless $pl->ob->flag (cf::FLAG_WIZ); |
12 | |
13 | my $arg = eval { thaw $msg->{arg} }; |
14 | my @res = eval $msg->{code}; |
15 | |
16 | $@ ? (error => $@) |
17 | : (result => nfreeze \@res) |
18 | }; |