git.shiar.nl
/
perl
/
plp
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
v3.06 release
[perl/plp/.git]
/
PLP
/
Functions.pm
diff --git
a/PLP/Functions.pm
b/PLP/Functions.pm
index 99aa27b1ffc1dd12a19fca30a8c2fe52dfb5a20a..e07caa5846deaa696c96efe2902f26aca5f31108 100644
(file)
--- a/
PLP/Functions.pm
+++ b/
PLP/Functions.pm
@@
-4,8
+4,8
@@
use base 'Exporter';
use strict;
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;
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::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 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;
sub HiddenFields ($@) {
my $hash = shift;
my %saves;
@@
-122,8
+133,8
@@
sub WriteFile ($$) {
sub Counter ($) {
local *COUNTER;
local $/ = undef;
sub Counter ($) {
local *COUNTER;
local $/ = undef;
- open COUNTER,
"+<$_[0]"
or
- open COUNTER,
">$_[0]"
or return undef;
+ open COUNTER,
'+<', $_[0]
or
+ open COUNTER,
'>', $_[0]
or return undef;
flock COUNTER, 2;
seek COUNTER, 0, 0;
my $counter = <COUNTER>;
flock COUNTER, 2;
seek COUNTER, 0, 0;
my $counter = <COUNTER>;