| 1 | package App::EvalServer::Language::Perl; | ||||||||||
| 2 | 2 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | $App::EvalServer::Language::Perl::AUTHORITY = 'cpan:HINRIK'; | |||||||||
| 4 | } | ||||||||||
| 5 | 2 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | $App::EvalServer::Language::Perl::VERSION = '0.08'; | |||||||||
| 7 | } | ||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | # TODO: attempt to load the utf8/unicode libraries. | ||||||||||
| 13 | #use utf8; | ||||||||||
| 14 | #use charnames qw(:full); | ||||||||||
| 15 | #BEGIN { | ||||||||||
| 16 | # eval "\$\343\201\257 = 42"; | ||||||||||
| 17 | # uc "\x{666}"; | ||||||||||
| 18 | #} | ||||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | sub evaluate { | ||||||||
|
Subroutine
evaluate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 21 | 1 | my ($package, $code) = @_; | |||||||||
| 22 | |||||||||||
| 23 | 1 | local $@ = undef; | |||||||||
| 24 | 1 | local @INC = undef; | |||||||||
| 25 | 1 | local $_ = undef; | |||||||||
| 26 | |||||||||||
| 27 | 1 | $code = "no strict; no warnings; package main; $code"; | |||||||||
| 28 | 1 | ▶ | my $ret = eval $code; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | print STDERR $@ if length($@); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 1 | return $ret; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 2 | 1; | |||||||||
| 35 | |||||||||||
| 36 | =encoding utf8 | ||||||||||
| 37 | |||||||||||
| 38 | =head1 NAME | ||||||||||
| 39 | |||||||||||
| 40 | App::EvalServer::Language::Perl - Evaluate Perl code | ||||||||||
| 41 | |||||||||||
| 42 | =head1 AUTHOR | ||||||||||
| 43 | |||||||||||
| 44 | Hinrik E<Ouml>rn SigurE<eth>sson, hinrik.sig@gmail.com | ||||||||||
| 45 | |||||||||||
| 46 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 47 | |||||||||||
| 48 | Copyright 2010 Hinrik E<Ouml>rn SigurE<eth>sson | ||||||||||
| 49 | |||||||||||
| 50 | This program is free software, you can redistribute it and/or modify | ||||||||||
| 51 | it under the same terms as Perl itself. | ||||||||||
| 52 | |||||||||||
| 53 | =cut | ||||||||||