v3.01 release
[perl/plp/.git] / PLP / Functions.pm
index 9d7b33c1c5d3a1a229e50dd1aa08e8d234dbb359..99aa27b1ffc1dd12a19fca30a8c2fe52dfb5a20a 100644 (file)
@@ -8,10 +8,13 @@ our @EXPORT = qw/HiddenFields Entity DecodeURI EncodeURI Entity include
                  AddCookie ReadFile WriteFile AutoURL Counter Include/;
 
 sub Include ($) {
-    my ($file) = $_[0];
+    no strict;
+    $PLP::file = $_[0];
     $PLP::inA = 0;
     $PLP::inB = 0;
-    eval PLP::source($file, 0);
+    local $@;
+    eval 'package PLP::Script; ' . PLP::source($PLP::file, 0, join ' ', (caller)[2,1]);
+    PLP::error($@, 1) if $@;
 }
 
 sub include ($) {