Skip to content

Commit 6681b73

Browse files
committed
Localize EVAL scope.
Fixes #300
1 parent d4c1e5f commit 6681b73

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

htmlify.p6

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env perl6
22
use v6;
3-
use MONKEY-SEE-NO-EVAL;
43

54
# This script isn't in bin/ because it's not meant to be installed.
65
# For syntax highlighting, needs pygmentize version 2.0 or newer installed
@@ -156,6 +155,11 @@ sub MAIN(
156155
}
157156
}
158157

158+
sub extract-pod($file) {
159+
use MONKEY-SEE-NO-EVAL;
160+
my $pod = EVAL(slurp($file.path) ~ "\n\$=pod")[0];
161+
}
162+
159163
sub process-pod-dir($dir, :&sorted-by = &[cmp], :$sparse) {
160164
say "Reading doc/$dir ...";
161165
my @pod-sources =
@@ -176,7 +180,7 @@ sub process-pod-dir($dir, :&sorted-by = &[cmp], :$sparse) {
176180
my $kind = $dir.lc;
177181
for @pod-sources.kv -> $num, (:key($filename), :value($file)) {
178182
printf "% 4d/%d: % -40s => %s\n", $num+1, $total, $file.path, "$kind/$filename";
179-
my $pod = EVAL(slurp($file.path) ~ "\n\$=pod")[0];
183+
my $pod = extract-pod($file.path);
180184
process-pod-source :$kind, :$pod, :$filename, :pod-is-complete;
181185
}
182186
}
@@ -656,7 +660,7 @@ sub write-disambiguation-files () {
656660
sub write-index-files () {
657661
say 'Writing html/index.html ...';
658662
spurt 'html/index.html',
659-
p2h(EVAL(slurp('doc/HomePage.pod') ~ "\n\$=pod"),
663+
p2h(extract-pod('doc/HomePage.pod'),
660664
pod-path => 'HomePage.pod');
661665

662666
say 'Writing html/language.html ...';

0 commit comments

Comments
 (0)