#!/usr/bin/perl -T use strict; use warnings;# qw(fatalsToBrowser warningsToBrowser); # FATAL => qw( all ); #use Base::HTML::Element; #CGI's functional interface, importing a standard set of subroutines #and the specified qw( *tag ) start_tag end_tag switch/pragma/syntax. #read the pod for descriptons of these use CGI qw(:standard *div); #sends HTML to server for humans to read, #comment out to collapse whitespace use CGI::Pretty; print header; #defaults to xml but can be defined to an HTML namespace print start_html( -title=>'My page title', -style=>{'src'=>'css/style.css'}, -script=>{'type'=>'JAVASCRIPT', 'src'=>'javascript/script.js'}, ); # end start_html, auto prints body opentag. print start_div({-class => 'div_class' }); #note start_div - else closes print h1({-id => 'sample_heading', -style => 'color:#666' },'My sample heading 1'); print p('A sample paragraph so you can see how this works.'); #css styling to do print ul({-id=>'colors'}, li({-type=>'disc',-style => 'color:#f00' },'red'), li({-type=>'disc',-style => 'color:#0f0' },'green'), li({-type=>'disc',-style => 'color:#00f' },'blue'), ); print p('Another paragraph for you'); print h2('A second sample heading'); print p('Guacamole or Bust'); print end_div(); # from imported *div flag print p({ id => 'end_remarks', class => 'remarks' }, 'Some end remarks.'); print end_html();