Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Adding From elements....

Thread Tools

Adding From elements....
Posts: n/a

I have a form with about 150 fields that I would like to have added
together automatically and the value placed into a new variable.
Below, you will see my @list. Below that, I'm going through @list and
only printing those values which have data (thanks to google.groups).

What I would like to do now, and I'm struggling a bit to do is add
these quantities anywhere I see "addquantity", I would
like to keep adding the values until done..then place them in a new
variable. Any hints??

my @list = (

[addzip2 => 'Additional Zip 2' ],
[addquantity2 => 'Additional Quantity 2' ],
[addzip3 => 'Additional Zip 3' ],
[addquantity3 => 'Additional Quantity 3' ],
[addzip4 => 'Additional Zip 4' ],
[addquantity4 => 'Additional Quantity 4' ],
[addzip5 => 'Additional Zip 5' ],
[addquantity5 => 'Additional Quantity 5' ],
[addzip6 => 'Additional Zip 6' ],
[addquantity6 => 'Additional Quantity 6' ],

for (@labels) {

if ( $query->param( $$_[0] ) ) {

print "$$_[1]: ", $query->param( $$_[0] ), "<br>";
print INT_EMAIL "$$_[1]: ", $query->param( $$_[0] ), "\n";


Reply With Quote
Tad McClellan
Posts: n/a
      02-11-2005 Removed) <(E-Mail Removed)> wrote:

> What I would like to do now, and I'm struggling a bit to do is add
> these quantities together

> Any hints??

Perl's addition operator is the plus sign (+).

Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question: Adding Wireless to a Hard-Wired Home Office (w/Web & Email) Nick Knight Wireless Networking 2 01-06-2005 03:46 AM
Adding an Antenna Pigtail to a WiFi card Guy Smith Wireless Networking 0 12-31-2004 11:15 AM
Adding Linksys or Dlink into a Microsoft networking product config =?Utf-8?B?c2tsZWZmbg==?= Wireless Networking 0 12-03-2004 04:12 PM
RE: Adding laptop to a new network =?Utf-8?B?TWFyayBQ?= Wireless Networking 0 10-20-2004 07:45 PM
Adding Wireless acess point to existing network. Shawn Wireless Networking 1 10-17-2004 03:53 PM