IC Home > Perl > Modules > Website.pm > Usage > Weitere Beispiele / More Samples

Website.pm


2.4 Weitere Beispiele / More Samples

24.03.2006

2.3 Using BLOCK command (Sections) [  up  ] - [ toc ] - [ home ] 3 Download

my %hash = ();

$hash{'ABC'} = 'DEF'; # Variable ABC will be replaced with value "DEF"

displayForm \%hash; # Fill in all variables with its values from %hash and display the page

sub displayForm (%) {
        my $args = $_[0];
        use Website;

        my $Website = Website->new( file => 'your-tpl.htm' );
        foreach (sort keys %$args) {
                $Website->let($_, $args->{$_}) if $args->{$_};
        }
        $Website->print( contentType_is_set => 0 );
}

copyright by retoh - created with mytexi