head 1.3; access; symbols STRING_DIVERT_0_96:1.3 STRING_DIVERT_0_95:1.2 STRING_DIVERT_0_94:1.2 STRING_DIVERT_0_93:1.2 STRING_DIVERT_0_92:1.2 STRING_DIVERT_0_91:1.2; locks; strict; comment @# @; 1.3 date 2005.11.16.12.08.49; author rse; state Exp; branches; next 1.2; commitid pA9WqyMLYDm0RY9r; 1.2 date 2003.05.23.11.09.57; author rse; state Exp; branches; next 1.1; 1.1 date 2003.05.22.18.56.51; author rse; state Exp; branches; next ; desc @@ 1.3 log @o add folding loop detection to "string" method o use anonymous names already in "new" method o don't follow diversions on "folding" method to allow one to divert back to upper objects, too. o document that "folding" method returns all foldings if no name or object is specified. o change sample2.pl to show the usual "head" diversion once one is already diverted in "body". @ text @ use lib "./blib/lib"; # create new object with operator overloading activated use String::Divert; my $html = new String::Divert; $html->overload(1); # generate outer HTML framework $html .= "\n" . "
\n" . " " . $html->folder("head") . " \n" . " \n" . " " . $html->folder("body") . " \n" . "\n"; $html >> "body"; # generate body $html .= "\n" . " " . $html->folder("left") . " | \n" . "\n" . " " . $html->folder("right") . " | \n" . "