Re: adding array elements

2001-09-07 Thread Curtis Poe
--- David Draley <[EMAIL PROTECTED]> wrote: > What would be the best way to add only the even array elements? > > @array[0..9]; > > #result of even elements > > thank you David, Just don't do: use strict; my @data = qw/ 1 2 3 4 5 9 /; my $sum = 0; map { $sum += $data[$_] if $

Re: FW: problem with using HTML::FormValidator

2001-09-07 Thread Mark Stosberg
Hello again Maryana, It appears that you are not following the format of the example given below, which is the cause of you error. You have the right idea about how to call an anonymous subroutine (like this: \&subroutine ). Here's a test script with the syntax you are looking for: ### use

RE: adding array elements

2001-09-07 Thread Bob Showalter
> -Original Message- > From: David Draley [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 07, 2001 7:18 AM > To: [EMAIL PROTECTED] > Subject: adding array elements > > > What would be the best way to add only the even array elements? > > @array[0..9]; > > #result of even elements

RE: Script compliation Sequence.

2001-09-07 Thread Bob Showalter
> -Original Message- > From: Rajeev Rumale [mailto:[EMAIL PROTECTED]] > Sent: Sunday, September 16, 2001 11:19 PM > To: [EMAIL PROTECTED] > Subject: Script compliation Sequence. > > > Hello EveryBody > > I needed some advice for all. > > I am working on a untilty which needs to perform

Re: FW: problem with using HTML::FormValidator

2001-09-07 Thread Maryana Osipchuk
Hi, Mark! Thanx for answer - it's partly help me to resolve my problem (now I use Data::FormValidator). Tnx for so usefull module ;o) But to call my function I need do it in that way: p1 => { constraint => \&main::valid_equiv, params => [ qw (p1 p2)], }, whe

Re: adding array elements

2001-09-07 Thread register
i can think of a few ways ... # loop through the array and check the index my $index = 1; for my $value (@array) { next if $index%2; push @only_even , $value; $index++; } # or you can shift two elements and use the last one ... for my $value (@array) { # you can a

adding array elements

2001-09-07 Thread David Draley
What would be the best way to add only the even array elements? @array[0..9]; #result of even elements thank you _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: [EMAIL PRO