Acme-PETEK-Testkit

 view release on metacpan or  search on metacpan

lib/Acme/PETEK/Testkit/modperl1.pm  view on Meta::CPAN


Generates the page HTML with a given value.

=cut

sub gen_page {
	my $value = shift;

	return <<HTML;
<html><head><title>Counter: $value</title></head>
<body><form method="post"><input type="hidden" name="cur" value="$value">
<div align="center">
	<p><big>Current Value: <u>$value</u></big></p>
	<p><input type="text" name="decrval" value="1" size="3" maxlength="3"
		/><input type="submit" name="decrn" value="&lt;&lt;"
		/><input type="submit" name="decr1" value="&lt;"
		/><input type="submit" name="reset" value="-0-" 
		/><input type="submit" name="incr1" value="&gt;"
		/><input type="submit" name="incrn" value="&gt;&gt;"
		/><input type="text" name="incrval" value="1" size="3" maxlength="3"
		/></p>
</div>
</body></html>
HTML
}

=head2 valid_int

Returns true if the supplied argument is a valid integer.

=cut

sub valid_int {
	my $int = shift;
	return 1 if $int =~ /^-?\d+$/;
	return;
}

=head1 AUTHOR

Pete Krawczyk, C<< <petek@cpan.org> >>

=head1 BUGS

Fix 'em yourself! :-)

=head1 ALSO SEE

Slides from the presentation are available at L<http://www.bsod.net/~petek/slides/>.

=head1 COPYRIGHT & LICENSE

Copyright 2005 Pete Krawczyk, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

This library has also been released under a Creative Commons license
at the request of the YAPC::NA 2005 organizers. See
L<http://creativecommons.org/licenses/by/2.0/ca/> for more information;
in short, please give credit to the author should you use this code
elsewhere.
=cut

1; # End of Acme::PETEK::Testkit::modperl1



( run in 2.796 seconds using v1.01-cache-2.11-cpan-ceb78f64989 )