From nheller at silcon.com Tue Jun 3 14:49:15 2008
From: nheller at silcon.com (Neil Heller)
Date: Tue, 3 Jun 2008 14:49:15 -0700
Subject: [sf-perl] [JOB] There might be interest
Message-ID: <000c01c8c5c3$ab5ad350$021079f0$@com>
I came across this email and thought I would re-post it here.
Hello,
I am working on a contractor search for a large high profile client of ours
that is looking for a strong Perl Developer. The position is located in
Walnut Creek, CA. and is 6+ months in length.
If you know anyone interested please contact me right away!
Thanks,
Rob Tomlinson
KCM Solutions
925 242-2318
Neil Heller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080603/ae3f540b/attachment.html
From Peter.Loo at source.wolterskluwer.com Tue Jun 3 15:03:28 2008
From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX)
Date: Tue, 3 Jun 2008 15:03:28 -0700
Subject: [sf-perl] UNSUBSCRIBE
Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A05E4AC6B@phxmail02.phx.ndchealth.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080603/7e7c1604/attachment.html
From david at fetter.org Tue Jun 3 16:07:29 2008
From: david at fetter.org (David Fetter)
Date: Tue, 3 Jun 2008 16:07:29 -0700
Subject: [sf-perl] SF Postgres Meeting Wednesday, June 11
Message-ID: <20080603230729.GC864@fetter.org>
Folks,
John Zarrella will be talking about parsers, and Josh Berkus will have
news about PgCon. RSVP at
for the usual logistical and courtesy reasons ;)
Cheers,
David.
--
David Fetter http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter at gmail.com
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
From josh at agliodbs.com Tue Jun 3 23:01:48 2008
From: josh at agliodbs.com (Josh Berkus)
Date: Tue, 03 Jun 2008 23:01:48 -0700
Subject: [sf-perl] [sfpug] SF Postgres Meeting Wednesday, June 11
In-Reply-To: <20080603230729.GC864@fetter.org>
References: <20080603230729.GC864@fetter.org>
Message-ID: <48462FCC.2030103@agliodbs.com>
All,
Updated description of the talk:
An Introduction to Parsing
No matter what language you use to write software --
from Basic and C to Java, Python, Perl and SQL -- a
parser is part of the behind-the-scenes machinery. The
parser is an essential part of translating what you
write into something that can be executed. It analyzes
your code and breaks it down into contants, variables,
statements, expressions, punctuation, etc.
We'll talk about what parsing is, how a parser works,
how parsing integrates with semantic analysis, and
discuss some different types of parsers and
compiler-compilers. We'll finish with a very brief
look at the PostgreSQL parser.
From kenuhl at berkeley.edu Wed Jun 4 13:43:36 2008
From: kenuhl at berkeley.edu (ken uhl)
Date: Wed, 04 Jun 2008 13:43:36 -0700
Subject: [sf-perl] passing checkboxes as hidden fields
Message-ID: <4846FE78.3080708@berkeley.edu>
Hi,
I have a question on how to determine the value of a checkbox ( checked
or unchecked ) when
passing check boxes as hidden fields to a separate cgi.
The checkboxes are all all the named 'tagbucket'
with different values,
so I retrieve those this way
use CGI;
my $cgi = new CGI;
my @boxes = $cgi->param('tagbucket');
This gives me a nice array of check box field names, but I don't know if
they are selected,
so I try retrieving each box :
for my $box ( @boxes ) {
my $box_data = $cgi->param($box);
};
This give me nothing.
By the way the check box is defined this way :
my $cb_name = "bulkdeleteHost-type-$htype-row-$hrowid" ;
my $be_bad = $cgi->checkbox( -name => "tagbucket" , -checked => 0,
-value => "$cb_name" , -label => "Bulk Delete?") ;
Any suggestions ?
From garth.webb at gmail.com Wed Jun 4 14:16:21 2008
From: garth.webb at gmail.com (Garth Webb)
Date: Wed, 4 Jun 2008 14:16:21 -0700
Subject: [sf-perl] passing checkboxes as hidden fields
In-Reply-To: <4846FE78.3080708@berkeley.edu>
References: <4846FE78.3080708@berkeley.edu>
Message-ID:
If a checkbox is unchecked, the browser will send nothing to you. Only if
the box is checked will you get a name=value pair.
On Wed, Jun 4, 2008 at 1:43 PM, ken uhl wrote:
> Hi,
> I have a question on how to determine the value of a checkbox ( checked
> or unchecked ) when
> passing check boxes as hidden fields to a separate cgi.
>
> The checkboxes are all all the named 'tagbucket'
> with different values,
> so I retrieve those this way
>
> use CGI;
> my $cgi = new CGI;
>
> my @boxes = $cgi->param('tagbucket');
>
> This gives me a nice array of check box field names, but I don't know if
> they are selected,
>
> so I try retrieving each box :
>
> for my $box ( @boxes ) {
> my $box_data = $cgi->param($box);
> };
>
> This give me nothing.
>
> By the way the check box is defined this way :
>
> my $cb_name = "bulkdeleteHost-type-$htype-row-$hrowid" ;
> my $be_bad = $cgi->checkbox( -name => "tagbucket" , -checked => 0,
> -value => "$cb_name" , -label => "Bulk Delete?") ;
>
> Any suggestions ?
>
>
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080604/23346ec2/attachment.html
From thomas at brightbill.net Wed Jun 4 14:24:55 2008
From: thomas at brightbill.net (Thomas Brightbill)
Date: Wed, 4 Jun 2008 14:24:55 -0700 (PDT)
Subject: [sf-perl] passing checkboxes as hidden fields
In-Reply-To: <4846FE78.3080708@berkeley.edu>
References: <4846FE78.3080708@berkeley.edu>
Message-ID:
On Wed, 4 Jun 2008, ken uhl wrote:
> The checkboxes are all all the named 'tagbucket'
> with different values,
> so I retrieve those this way
>
> use CGI;
> my $cgi = new CGI;
>
> my @boxes = $cgi->param('tagbucket');
>
> This gives me a nice array of check box field names, but I don't know if
> they are selected,
Isn't the name of all the checkboxes "tagbucket"?
This should give you an array containing all the values of the *checked*
checkboxes (e.g. $cb_name_X, $cb_name_Y, $cb_name_Z, ....)
> Any suggestions ?
check the HTML. are the names and values being properly generated for
the 'tagbucket' checkboxes on your form.
you could also add
use Data::Dumper;
and
print Dumper(@boxes)
to help troubleshoot.
HTH,
Thomas
Thomas Brightbill
thomas at brightbill.net
http://www.brightbill.net
From thomas at brightbill.net Wed Jun 4 14:36:05 2008
From: thomas at brightbill.net (Thomas Brightbill)
Date: Wed, 4 Jun 2008 14:36:05 -0700 (PDT)
Subject: [sf-perl] passing checkboxes as hidden fields
In-Reply-To:
References: <4846FE78.3080708@berkeley.edu>
Message-ID:
On Wed, 4 Jun 2008, ken uhl wrote:
> so I try retrieving each box :
>
> for my $box ( @boxes ) {
> my $box_data = $cgi->param($box);
> };
>
> This give me nothing.
To expand a little more on my earlier message, I would think that this
should give you nothing. Aren't the checkboxes named 'tagbucket'? Their
values are $cb_name_X, $cb_name_Y, etc.
The form shouldn't be passing the script any parameters named $cb_name_X,
$cb_name_Y - only values in the tagbucket array.
Also, I'm a little confused with the title of your posting - the fields
are hidden?
Thomas
Thomas Brightbill
thomas at brightbill.net
http://www.brightbill.net
From friedman at highwire.stanford.edu Wed Jun 4 14:51:05 2008
From: friedman at highwire.stanford.edu (Michael Friedman)
Date: Wed, 4 Jun 2008 14:51:05 -0700
Subject: [sf-perl] passing checkboxes as hidden fields
In-Reply-To:
References: <4846FE78.3080708@berkeley.edu>
Message-ID: <940C1BD9-5B71-4BAD-9DBD-3860190464E1@highwire.stanford.edu>
Er, also not to mention the scoping. 'my $box_data' is only available
inside the braces of the for loop. But I assume that's an artifact of
the way you cut down the example to post here and not a problem in
your original code.
-- Mike
On Jun 4, 2008, at 2:36 PM, Thomas Brightbill wrote:
>
> On Wed, 4 Jun 2008, ken uhl wrote:
>
>> so I try retrieving each box :
>>
>> for my $box ( @boxes ) {
>> my $box_data = $cgi->param($box);
>> };
>>
>> This give me nothing.
>
> To expand a little more on my earlier message, I would think that this
> should give you nothing. Aren't the checkboxes named 'tagbucket'?
> Their
> values are $cb_name_X, $cb_name_Y, etc.
>
> The form shouldn't be passing the script any parameters named
> $cb_name_X,
> $cb_name_Y - only values in the tagbucket array.
>
> Also, I'm a little confused with the title of your posting - the
> fields
> are hidden?
>
> Thomas
>
>
>
> Thomas Brightbill
> thomas at brightbill.net
> http://www.brightbill.net
>
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
---------------------------------------------------------------------
Michael Friedman HighWire Press
Phone: 650-725-1974 Stanford University
FAX: 270-721-8034
---------------------------------------------------------------------
From quinn at fairpath.com Wed Jun 4 21:51:48 2008
From: quinn at fairpath.com (Quinn Weaver)
Date: Wed, 4 Jun 2008 21:51:48 -0700
Subject: [sf-perl] Fwd: [sfpug] PostgreSQL training in Santa Clara, June 23
References: <48474DB8.3080204@agliodbs.com>
Message-ID: <4C5DF815-0F8D-4E3C-9F65-8423AF2CBD04@fairpath.com>
Sone info on an upcoming PostgreSQL course run by Josh Berkus. If you
need the training, and your employer will pay for it, I can't imagine
a better instructor.
--
Quinn Weaver
Full-stack web consultant
http://fairpath.com/
510-520-5217 (mobile)
Begin forwarded message:
> From: Josh Berkus
> Date: June 4, 2008 7:21:44 PM PDT
> To: SF Postgres
> Subject: [sfpug] PostgreSQL training in Santa Clara, June 23
>
> All,
>
> From project supporter Open Technology Group:
>
> I've got a confirmed-to-run PostgreSQL course going on in Santa
> Clara, CA the week of June 23, 2008 . Currently it's a small class
> (only 3 students), so folks who attend will definitely get lots of
> one-on-one instructor time there.
> If you know of anyone who might be interested, please do let them
> know...or if its possible to pass this on to your local PUG, that
> would be great... The price for the 5 day class is $2,195 ($100
> less for gov't/education customers, and group discounts are
> available as well). A course outline and details is available at : http://otg-nc.com/training-courses/coursedetail.php?courseid=40
> . If you've got multiple PUG people who want to attend, I can
> apply a multi-student discount to them..or make a donation to the PUG.
>
> Please forward!
>
> --Josh Berkus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080604/436cd737/attachment.html
From josh at agliodbs.com Thu Jun 5 06:06:22 2008
From: josh at agliodbs.com (Josh Berkus)
Date: Thu, 05 Jun 2008 09:06:22 -0400
Subject: [sf-perl] Fwd: [sfpug] PostgreSQL training in Santa Clara,
June 23
In-Reply-To: <4C5DF815-0F8D-4E3C-9F65-8423AF2CBD04@fairpath.com>
References: <48474DB8.3080204@agliodbs.com>
<4C5DF815-0F8D-4E3C-9F65-8423AF2CBD04@fairpath.com>
Message-ID: <4847E4CE.10205@agliodbs.com>
Quinn Weaver wrote:
> Sone info on an upcoming PostgreSQL course run by Josh Berkus. If you
> need the training, and your employer will pay for it, I can't imagine a
> better instructor.
>
Ooops! I'm not giving the course. This is from Open Technology Group,
actually. The instructure is probably Robert Bernier.
--Josh
From kenuhl at berkeley.edu Thu Jun 5 12:17:03 2008
From: kenuhl at berkeley.edu (ken uhl)
Date: Thu, 05 Jun 2008 12:17:03 -0700
Subject: [sf-perl] Those darn check boxes ...
In-Reply-To:
References:
Message-ID: <48483BAF.8020101@berkeley.edu>
Thanks all who chimed in, Garth, Tom, Mike :
To respond to all your clarifying questions, and my progress so far:
I am using hidden fields in HTML to pass check boxes to a different
script, thusly:
This way I retrieve all the check box field names, regardless of whether
they are checked or not.
if I simply pass the hidden fields as
I get zippo - no check box names, no value pairs. I guess there is a
different path I should be on....
Ken Uhl
sanfrancisco-pm-request at pm.org wrote:
( snipped intervening text )
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 04 Jun 2008 13:43:36 -0700
> From: ken uhl
> Subject: [sf-perl] passing checkboxes as hidden fields
> To: sanfrancisco-pm at pm.org
> Message-ID: <4846FE78.3080708 at berkeley.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
> I have a question on how to determine the value of a checkbox ( checked
> or unchecked ) when
> passing check boxes as hidden fields to a separate cgi.
>
> The checkboxes are all all the named 'tagbucket'
> with different values,
> so I retrieve those this way
>
> use CGI;
> my $cgi = new CGI;
>
> my @boxes = $cgi->param('tagbucket');
>
> This gives me a nice array of check box field names, but I don't know if
> they are selected,
>
> so I try retrieving each box :
>
> for my $box ( @boxes ) {
> my $box_data = $cgi->param($box);
> };
>
> This give me nothing.
>
> By the way the check box is defined this way :
>
> my $cb_name = "bulkdeleteHost-type-$htype-row-$hrowid" ;
> my $be_bad = $cgi->checkbox( -name => "tagbucket" , -checked => 0,
> -value => "$cb_name" , -label => "Bulk Delete?") ;
>
> Any suggestions ?
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 4 Jun 2008 14:16:21 -0700
> From: "Garth Webb"
> Subject: Re: [sf-perl] passing checkboxes as hidden fields
> To: "San Francisco Perl Mongers User Group"
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> If a checkbox is unchecked, the browser will send nothing to you. Only if
> the box is checked will you get a name=value pair.
>
> On Wed, Jun 4, 2008 at 1:43 PM, ken uhl wrote:
>
>
snip
> ------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080604/23346ec2/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Wed, 4 Jun 2008 14:24:55 -0700 (PDT)
> From: Thomas Brightbill
> Subject: Re: [sf-perl] passing checkboxes as hidden fields
> To: San Francisco Perl Mongers User Group
> Message-ID:
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>
snip
> On Wed, 4 Jun 2008, ken uhl wrote:
>
>
Isn't the name of all the checkboxes "tagbucket"?
> This should give you an array containing all the values of the *checked*
> checkboxes (e.g. $cb_name_X, $cb_name_Y, $cb_name_Z, ....)
>
>
> check the HTML. are the names and values being properly generated for
> the 'tagbucket' checkboxes on your form.
>
> you could also add
>
> use Data::Dumper;
>
> and
>
> print Dumper(@boxes)
>
> to help troubleshoot.
>
> HTH,
>
> Thomas
>
>
> Thomas Brightbill
> thomas at brightbill.net
> http://www.brightbill.net
>
> ------------------------------
> To expand a little more on my earlier message, I would think that this
> should give you nothing. Aren't the checkboxes named 'tagbucket'? Their
> values are $cb_name_X, $cb_name_Y, etc.
>
> The form shouldn't be passing the script any parameters named $cb_name_X,
> $cb_name_Y - only values in the tagbucket array.
>
> Also, I'm a little confused with the title of your posting - the fields
> are hidden?
>
> Thomas
>
>
>
snip
From nheller at silcon.com Thu Jun 5 12:23:34 2008
From: nheller at silcon.com (Neil Heller)
Date: Thu, 5 Jun 2008 12:23:34 -0700
Subject: [sf-perl] Those darn check boxes ...
In-Reply-To: <48483BAF.8020101@berkeley.edu>
References:
<48483BAF.8020101@berkeley.edu>
Message-ID: <004601c8c741$a5b84de0$f128e9a0$@com>
I notice a lot of duplication in your object descriptions.
Might it be advantageous to just pass the unique portions to a subroutine?
Neil Heller
-----Original Message-----
From: sanfrancisco-pm-bounces+nheller=silcon.com at pm.org
[mailto:sanfrancisco-pm-bounces+nheller=silcon.com at pm.org] On Behalf Of ken
uhl
Sent: Thursday, June 05, 2008 12:17 PM
To: sanfrancisco-pm at pm.org
Subject: [sf-perl] Those darn check boxes ...
Thanks all who chimed in, Garth, Tom, Mike :
To respond to all your clarifying questions, and my progress so far:
I am using hidden fields in HTML to pass check boxes to a different
script, thusly:
This way I retrieve all the check box field names, regardless of whether
they are checked or not.
if I simply pass the hidden fields as
I get zippo - no check box names, no value pairs. I guess there is a
different path I should be on....
Ken Uhl
sanfrancisco-pm-request at pm.org wrote:
( snipped intervening text )
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 04 Jun 2008 13:43:36 -0700
> From: ken uhl
> Subject: [sf-perl] passing checkboxes as hidden fields
> To: sanfrancisco-pm at pm.org
> Message-ID: <4846FE78.3080708 at berkeley.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
> I have a question on how to determine the value of a checkbox ( checked
> or unchecked ) when
> passing check boxes as hidden fields to a separate cgi.
>
> The checkboxes are all all the named 'tagbucket'
> with different values,
> so I retrieve those this way
>
> use CGI;
> my $cgi = new CGI;
>
> my @boxes = $cgi->param('tagbucket');
>
> This gives me a nice array of check box field names, but I don't know if
> they are selected,
>
> so I try retrieving each box :
>
> for my $box ( @boxes ) {
> my $box_data = $cgi->param($box);
> };
>
> This give me nothing.
>
> By the way the check box is defined this way :
>
> my $cb_name = "bulkdeleteHost-type-$htype-row-$hrowid" ;
> my $be_bad = $cgi->checkbox( -name => "tagbucket" , -checked => 0,
> -value => "$cb_name" , -label => "Bulk Delete?") ;
>
> Any suggestions ?
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 4 Jun 2008 14:16:21 -0700
> From: "Garth Webb"
> Subject: Re: [sf-perl] passing checkboxes as hidden fields
> To: "San Francisco Perl Mongers User Group"
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> If a checkbox is unchecked, the browser will send nothing to you. Only if
> the box is checked will you get a name=value pair.
>
> On Wed, Jun 4, 2008 at 1:43 PM, ken uhl wrote:
>
>
snip
> ------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080604/23346ec2/a
ttachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Wed, 4 Jun 2008 14:24:55 -0700 (PDT)
> From: Thomas Brightbill
> Subject: Re: [sf-perl] passing checkboxes as hidden fields
> To: San Francisco Perl Mongers User Group
> Message-ID:
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
>
snip
> On Wed, 4 Jun 2008, ken uhl wrote:
>
>
Isn't the name of all the checkboxes "tagbucket"?
> This should give you an array containing all the values of the *checked*
> checkboxes (e.g. $cb_name_X, $cb_name_Y, $cb_name_Z, ....)
>
>
> check the HTML. are the names and values being properly generated for
> the 'tagbucket' checkboxes on your form.
>
> you could also add
>
> use Data::Dumper;
>
> and
>
> print Dumper(@boxes)
>
> to help troubleshoot.
>
> HTH,
>
> Thomas
>
>
> Thomas Brightbill
> thomas at brightbill.net
> http://www.brightbill.net
>
> ------------------------------
> To expand a little more on my earlier message, I would think that this
> should give you nothing. Aren't the checkboxes named 'tagbucket'? Their
> values are $cb_name_X, $cb_name_Y, etc.
>
> The form shouldn't be passing the script any parameters named $cb_name_X,
> $cb_name_Y - only values in the tagbucket array.
>
> Also, I'm a little confused with the title of your posting - the fields
> are hidden?
>
> Thomas
>
>
>
snip
_______________________________________________
SanFrancisco-pm mailing list
SanFrancisco-pm at pm.org
http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
From thomas at brightbill.net Thu Jun 5 13:10:55 2008
From: thomas at brightbill.net (Thomas Brightbill)
Date: Thu, 5 Jun 2008 13:10:55 -0700 (PDT)
Subject: [sf-perl] Those darn check boxes ...
In-Reply-To: <48483BAF.8020101@berkeley.edu>
References:
<48483BAF.8020101@berkeley.edu>
Message-ID:
On Thu, 5 Jun 2008, ken uhl wrote:
> I am using hidden fields in HTML to pass check boxes to a different
> script, thusly:
> This way I retrieve all the check box field names, regardless of whether
> they are checked or not.
Ken,
If I'm reading this - and your original post - correctly, the problem is
that you're passing *all* checkboxes to a confirmation page as "" and then trying to figure out which of those hidden
tags were orignally checked...
Seems to me, only the *checked* checkboxes should be passed to the
confirmation page.
Thomas
Thomas Brightbill
thomas at brightbill.net
http://www.brightbill.net
From ddascalescu at gmail.com Thu Jun 5 17:17:11 2008
From: ddascalescu at gmail.com (Dan Dascalescu)
Date: Thu, 5 Jun 2008 17:17:11 -0700
Subject: [sf-perl] Those darn check boxes ...
In-Reply-To: <48483BAF.8020101@berkeley.edu>
References:
<48483BAF.8020101@berkeley.edu>
Message-ID: <3561cc6d0806051717n46df0a69of0f964164e6b1089@mail.gmail.com>
Maybe you'd like to consider using the Catalyst Framework and FormFu?
http://www.catalystframework.org/calendar/2007/20
--
Dan
On Thu, Jun 5, 2008 at 12:17 PM, ken uhl wrote:
>
> Thanks all who chimed in, Garth, Tom, Mike :
>
> To respond to all your clarifying questions, and my progress so far:
>
> I am using hidden fields in HTML to pass check boxes to a different
> script, thusly:
[...]
From thomas at brightbill.net Thu Jun 5 17:57:41 2008
From: thomas at brightbill.net (Thomas Brightbill)
Date: Thu, 5 Jun 2008 17:57:41 -0700 (PDT)
Subject: [sf-perl] Those darn check boxes ...
Message-ID:
Ken,
Does the following example get you closer to where you're trying to go?
Thomas Brightbill
thomas at brightbill.net
http://www.brightbill.net
------------------------------------------------------------------------
#!/usr/bin/perl
use CGI;
use strict;
my $q = new CGI;
my $called_by = $q->param('submit');
my $confirmed = $q->param('confirmed');
my $script_name = "tagbucket_template";
my ($message,$formstuff);
# check how we were called
if ($called_by ne 'submit') {
# this is the first time the form is displayed
# get some names from a database
# assume for now that the database returns an array
# with something like the following
my @results = ('red','orange','yellow','green','blue','indigo','violet');
$formstuff = $q->checkbox_group(-name=>'tagbucket',
-values=>\@results,
-linebreak=>'true');
} else {
if ($confirmed ne 'yes') {
# this is the confirmation page
my @stuff_to_delete = $q->param('tagbucket');
$message = $q->p("Are you sure you want to delete the following items?");
$message .= $q->ul($q->li(\@stuff_to_delete));
$formstuff = $q->hidden(-name=>'tagbucket',\@stuff_to_delete);
$formstuff .= $q->checkbox(-name=>'confirmed', -value=>'yes',
-label=>'Yes, I want to delete this stuff!');
$formstuff .= $q->br();
} else {
# this is the actual deletion
my @stuff_to_delete = $q->param('tagbucket');
# delete stuff from database
# create confirmation message
$message = $q->p("The following stuff has been deleted:");
$message .= $q->ul($q->li(\@stuff_to_delete));
}
}
# page output
print $q->header;
print $q->start_html('Tagbucket Template');
print $q->p($message);
print qq|