line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl6::Slurp::Interpret; |
2
|
|
|
|
|
|
|
our $VERSION = '0.15'; |
3
|
1
|
|
|
1
|
|
31545
|
use 5.008008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
47
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package main; # main so that the function evalues in the caller's name space. |
6
|
|
|
|
|
|
|
# use strict ; # strict is disabled to allow global variables |
7
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
8
|
1
|
|
|
1
|
|
865
|
use Perl6::Slurp; |
|
1
|
|
|
|
|
2463
|
|
|
1
|
|
|
|
|
8
|
|
9
|
1
|
|
|
1
|
|
1116
|
use Inline::Files; |
|
1
|
|
|
|
|
15288
|
|
|
1
|
|
|
|
|
8
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require Exporter; |
12
|
|
|
|
|
|
|
# use AutoLoader qw(AUTOLOAD); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
17
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
18
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# This allows declaration use Perl6::Slurp::Interpret ':all'; |
21
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
22
|
|
|
|
|
|
|
# will save memory. |
23
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( eval_slurp quote_slurp) ] ); |
24
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
25
|
|
|
|
|
|
|
our @EXPORT = qw( eval_slurp quote_slurp ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Preloaded methods go here. |
31
|
|
|
|
|
|
|
sub eval_slurp { |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# use Perl6::Say; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
return( |
36
|
|
|
|
|
|
|
eval( |
37
|
1
|
|
|
1
|
|
14
|
quote_slurp( @_ ) |
38
|
|
|
|
|
|
|
) |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub quote_slurp { |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
1
|
|
8
|
my $slurp = &slurp( @_ ); |
47
|
1
|
|
|
|
|
291
|
$slurp =~ s/\\/\\/g; |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
121
|
return( '"' . $slurp . '"' ); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
__END__ |