new maintainer: shiar
[perl/plp/.git] / PLP / Functions.pm
index 61d145dbc2e2948c520f655cc2f32d922bb0810c..3a0f0023c103c178b4777b1cbb3311b103403a0f 100644 (file)
@@ -1,6 +1,5 @@
-#-------------------------#
-  package PLP::Functions;
-#-------------------------#
+package PLP::Functions;
+
 use base 'Exporter';
 use Fcntl qw(:flock);
 use strict;
@@ -16,7 +15,7 @@ sub Include ($) {
     local $@;
     eval 'package PLP::Script; ' . PLP::source($PLP::file, 0, join ' ', (caller)[2,1]);
     if ($@) {
-       PLP::Functions::exit if $@ =~ /\cS\cT\cO\cP/;
+       PLP::Functions::exit() if $@ =~ /\cS\cT\cO\cP/;
        PLP::error($@, 1);
     }
 }
@@ -67,9 +66,9 @@ sub Entity (@) {
     return defined wantarray ? (wantarray ? @$ref : "@$ref") : undef;
 }
 
-# Browsers do s/ /+/ - I don't care about RFC's, but I do care about real-life
-# situations.
 sub DecodeURI (@) {
+    # Browsers do s/ /+/ - I don't care about RFC's, but I do care about real-life
+    # situations.
     my @r;
     local $_;    
     for (@_) {
@@ -85,6 +84,7 @@ sub DecodeURI (@) {
     }
     return defined wantarray ? (wantarray ? @r : "@r") : undef;
 }
+
 sub EncodeURI (@) {
     my @r;
     local $_;
@@ -217,6 +217,16 @@ Some context examples:
 
 Executes another PLP file, that will be parsed (i.e. code must be in C<< <: :> >>). As with Perl's C<do>, the file is evaluated in its own lexical file scope, so lexical variables (C<my> variables) are not shared. PLP's C<< <(filename)> >> includes at compile-time, is faster and is doesn't create a lexical scope (it shares lexical variables).
 
+Include can be used recursively, and there is no depth limit:
+
+    <!-- This is crash.plp -->
+    <:
+        include 'crash.plp';
+        # This example will loop forever,
+        # and dies with an out of memory error.
+       # Do not try this at home.
+    :>
+
 =item include FILENAME
 
 An alias for C<Include>.
@@ -287,7 +297,9 @@ Adds a Set-Cookie header. STRING must be a valid Set-Cookie header value.
 
 =head1 AUTHOR
 
-Juerd Waalboer <juerd@juerd.nl>
+Juerd Waalboer <juerd@cpan.org>
+
+Current maintainer: Mischa POSLAWSKY <shiar@cpan.org>
 
 =cut