PERL:



              

PERL: - . 666


use strict;

use CGI qw(.standard);

use CGI'iCarp qw(fatalsToBrowser);

my %States;

#

-

#

my $Current_Screen;

#

.

%States = (

'Default'

=>

\&front_page,

'Shirt'

=>

\&shirt,

'Sweater'

=>

\&sweater,

'Checkout'

=>

\&checkout,

'Card'

=>

\&credit_card,

'Order'

=>

\&order,

'Cancel'

=>

\&front_page,

$Current_Screen = param(".State") || "Default1;

die 'No screen for $Current_Screen" unless $States{$Current_Screen};

# . standard_header();

while (my($screen_name, Sfunction) = each %States) { $function->($screen_name eq $Current_Screen);

standard_footer(); exit;

#################################


19.14. : chemiserie 699

# ,

sub standard_header {

print header(), start_html(-Title => "Shirts", -BGC0L0R=>"White"); print start_form(); # start_multipart_form() if file upload

sub standard_footer { print end_form(), end_html() }

sub shop_menu {

print p(defaults("Empty My Shopping Cart"), to_page("Snirt"), to_page("Sweater"), to_page("Checkout"));

#################################


#################################

#  ,
sub front_page {

my $active = shift; return unless $active;

print "<H1>Hi!</H1>\n";

print "Welcome to our Shirt Shop1 Please make your selection from

print "the menu below.\n";

shop_menu();

# , sub shirt {

my Sactive = shift;

my sizes = qw(XL L M S);

my colors = qw(Black White);

my ($size, $color, $count) =

(param("shirt_size"), param("shirt_color"), param("shirt_count"));