X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=samples%2Fapp%2Fapp1%2Flib%2FApp1%2FDoBill.pm;fp=samples%2Fapp%2Fapp1%2Flib%2FApp1%2FDoBill.pm;h=e759e918ac0490eabc4dd4b4f7c7b5e4a6ecc206;hp=0000000000000000000000000000000000000000;hb=ed00221d27dfab1e82ec2ea040ab4c399a91c545;hpb=0b04f67c06c1db11969096f07dfc7dbb23bf99ba diff --git a/samples/app/app1/lib/App1/DoBill.pm b/samples/app/app1/lib/App1/DoBill.pm new file mode 100644 index 0000000..e759e91 --- /dev/null +++ b/samples/app/app1/lib/App1/DoBill.pm @@ -0,0 +1,47 @@ +package App1::DoBill; + +=head1 NAME + +App1::DoBill - This step would process the billing + +=cut + +use strict; +use warnings; +use base qw(App1); +use CGI::Ex::Dump qw(debug); + +sub run_step { + my $self = shift; + + my $r = $self->cgix->apache_request; + local $| = 1 if ! $r; + + $self->cgix->print_content_type; + + print "
\n"; + print "At this point I would do something useful with the form data
\n"; + print "I would probably add the customer and lineitems and bill the order
\n"; + debug $self->form; + print "But for now I will just pretend I'm doing something for 10 seconds
\n"; + + my $max = 10; + for my $i (1 .. $max) { + $r->rflush if $r; + sleep 1; + print "Sleep $i/$max
\n"; + } + + print "
\n"; + # this little progress effect would be better off with something like yui + print "\n"; + + return 0; +} + +1; +