The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache::HeavyCGI::Layout - Represent a page layout in an array

SYNOPSIS

 my $layout = Apache::HeavyCGI::Layout->new(@array);

 $layout->prejoin;  # make the array more compact

 my @array = $layout->content;
 my $string = $layout->as_string($object);

DESCRIPTION

The constructor new() takes as an argument an array of elements. Elements may be strings and objects in any order.

The content() method returns the array of elements.

The prejoin() method joins adjacent string elements, leaving at most one string element between objects in the array.

The as_string() method takes an object, say $mgr, as an argument and joins all elements of the array such that all chunks that represent an object are called with

    $chunk->as_string($mgr)

and all chunks that represent a string are fillers in between. Objects that do not understand the as_string method are just filled in as strings, leaving room for debugging or overloading or whatever.