X-Git-Url: http://git.shiar.net/perl/plp/.git/blobdiff_plain/7685d1a41798147fed9cdeb4edee8920b8c39672..4cbac41f4d1bef193cf955c6c854c8a9ed258119:/PLP/Functions.pm diff --git a/PLP/Functions.pm b/PLP/Functions.pm index 080c615..e07caa5 100644 --- a/PLP/Functions.pm +++ b/PLP/Functions.pm @@ -4,8 +4,8 @@ use base 'Exporter'; use strict; -our @EXPORT = qw/HiddenFields Entity DecodeURI EncodeURI Entity include - AddCookie ReadFile WriteFile AutoURL Counter Include/; +our @EXPORT = qw/HiddenFields Entity DecodeURI EncodeURI Entity include PLP_END + AddCookie ReadFile WriteFile AutoURL Counter Include exit/; sub Include ($) { no strict; @@ -14,13 +14,24 @@ sub Include ($) { $PLP::inB = 0; local $@; eval 'package PLP::Script; ' . PLP::source($PLP::file, 0, join ' ', (caller)[2,1]); - PLP::error($@, 1) if $@; + if ($@) { + PLP::Functions::exit if $@ =~ /\cS\cT\cO\cP/; + PLP::error($@, 1); + } } sub include ($) { goto &Include; } +sub exit (;$) { + die "\cS\cT\cO\cP\n"; +} + +sub PLP_END (&) { + push @PLP::END, shift; +} + sub HiddenFields ($@) { my $hash = shift; my %saves;