#!perl -w use strict; no strict "vars"; use Data::Locations; # ====================================================================== # $toplocation = Data::Locations->new(); # $sublocation = $location->new(); # $location->filename($filename); # $location->print(@items); # $location->print($sublocation); # @list = $location->read(); # ====================================================================== print "1..1\n"; $n = 1; $html = Data::Locations->new("example.html"); $html->println(""); $head = $html->new(); $body = $html->new(); $html->println(""); $head->println(""); $tohead = $head->new(); $head->println(""); $body->println(""); $tobody = $body->new(); $body->println(""); $tohead->print(""); $title = $tohead->new(); $tohead->println(""); $tohead->print(''); $tohead->print(''); $tobody->println("
"); $tobody->print("

"); $tobody->print($title); ## Re-using this location!! $tobody->println("

"); $contents = $tobody->new(); $tobody->println("
"); $title->print("'Data::Locations' Example HTML-Page"); $description->println("Example for generating HTML pages"); $description->print("using 'Data::Locations'"); $keywords->print("locations, magic, insertion points,\n"); $keywords->print("nested, recursive"); $contents->println("This page was generated using the"); $contents->println("

"); $contents->println(""Data::Locations""); $contents->println("

"); $contents->println("module for Perl."); $txt = join('', $html->read()); $ref = <<'VERBATIM'; 'Data::Locations' Example HTML-Page

'Data::Locations' Example HTML-Page

This page was generated using the

"Data::Locations"

module for Perl.

VERBATIM if ($txt eq $ref) {print "ok $n\n";} else {print "not ok $n\n";} $n++; $html->filename(""); __END__