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 *** |
# | User | Rev | Content |
---|---|---|---|
1 | elmex | 1.1 | #! perl |
2 | |||
3 | root | 1.2 | use Storable qw/nfreeze thaw/; |
4 | elmex | 1.1 | |
5 | root | 1.2 | my %global; # for use by eval'ed commands |
6 | |||
7 | cf::register_extcmd perl_eval => sub { | ||
8 | root | 1.4 | my ($pl, $msg) = @_; |
9 | root | 1.2 | |
10 | root | 1.4 | return (error => "error permission denied") |
11 | unless $pl->ob->flag (cf::FLAG_WIZ); | ||
12 | root | 1.2 | |
13 | root | 1.4 | my $arg = eval { thaw $msg->{arg} }; |
14 | my @res = eval $msg->{code}; | ||
15 | root | 1.2 | |
16 | root | 1.4 | $@ ? (error => $@) |
17 | : (result => nfreeze \@res) | ||
18 | root | 1.2 | }; |