The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
: # feed this into perl
	eval 'exec perl -S $0 ${1+"$@"}'
		if $running_under_some_shell;

#
# $Id: getform,v 0.1 2001/03/31 10:54:03 ram Exp $
#
#  Copyright (c) 2001, Raphael Manfredi
#  
#  You may redistribute only under the terms of the Artistic License,
#  as specified in the README file that comes with the distribution.
#
# HISTORY
# $Log: getform,v $
# Revision 0.1  2001/03/31 10:54:03  ram
# Baseline for first Alpha release.
#
# $EndLog$
#

use CGI qw/:standard/;

$\ = "\n";

print header;
my $method = param("method") || request_method();
my $action = param("action") || url();
print start_html("$method form"), h1("$method form");
print startform(
	-method		=> $method eq "POST" ? "POST" : "GET",
	-enctype	=> param("enctype") eq "M" ?
			"multipart/form-data" : "application/x-www-form-urlencoded",
	-action		=> $action,
);

my $counter = param("counter") + 1;
param("counter", $counter);
print hidden("counter");
print hidden("enctype");

print "Title: ", radio_group(
	-name		=> "title",
	-values		=> [qw(Mr Ms Miss)],
	-default	=> 'Mr'), br;

print "Name: ", textfield("name"), br;

print "Skills: ", checkbox_group(
	-name		=> "skills",
	-values		=> [qw(cooking drawing teaching listening)],
	-defaults	=> ['listening'],
), br;

print "New here: ", checkbox(
	-name		=> "new",
	-checked	=> 1,
	-value		=> "ON",
	-label		=> "click me",
), br;


print "Color: ", popup_menu(
	-name		=> "color",
	-values		=> [qw(white black green red blue)],
	-default	=> "white",
), br;

print "Note: ", textarea("note"), br;

print "Prefers: ", scrolling_list(
	-name		=> "months",
	-values		=> [qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)],
	-size		=> 5,
	-multiple	=> 1,
	-default	=> [qw(Jul)],
), br;

print "Password: ", password_field(
	-name		=> "passwd",
	-size		=> 10,
	-maxlength	=> 15,
), br;

print "Portrait: ", filefield(
	-name		=> "portrait",
	-size		=> 30,
	-maxlength	=> 80,
), br;

print p(
	reset(),
	defaults("default"),
	submit("Send"),
	image_button(
		-name	=> "img_send",
		-alt	=> "GO!",
		-src	=> "go.png",
		-width	=> 50,
		-height	=> 30,
		-border	=> 0,
	),
);

print endform;
print end_html;