RE: check array element (HELP)

2001-08-01 Thread Bob Showalter
> -Original Message- > From: Paul [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 01, 2001 3:41 PM > To: Bob Showalter; '[EMAIL PROTECTED]' > Subject: RE: check array element (HELP) > > > > --- Bob Showalter <[EMAIL PROTECTED]> wrote:

RE: check array element (HELP)

2001-08-01 Thread Paul
--- Bob Showalter <[EMAIL PROTECTED]> wrote: > . . . > Yep, you've got it. Actually map() is creating a *list*, which is > being used to initalize an anonymous hash. Working from the inside > out: > >map { ($_ => 1) } @arr > > returns a list equivalent to ($arr[0], 1, $arr[1], 1, $arr[

RE: check array element (HELP)

2001-08-01 Thread Bob Showalter
> -Original Message- > From: Wagner Jeff Civ Logicon/TTMS > [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 01, 2001 2:14 PM > To: Bob Showalter > Cc: '[EMAIL PROTECTED]' > Subject: RE: check array element (HELP) > > > Let me see if I under

RE: check array element (HELP)

2001-08-01 Thread Paul
array elements every > time and the iterative approach drops out as soon as it finds a > duplicate. Mainly. =o) Good job. > -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 31, 2001 09:03 > To: '[EMAIL PROTECTED]'

RE: check array element (HELP)

2001-08-01 Thread Paul
--- Wagner Jeff Civ Logicon/TTMS <[EMAIL PROTECTED]> wrote: > . . . I would guess that, behind the scenes, the > hash implementation is doing a similar amount of work (perhaps an > insertion sort). Actually, it's called a "hash" because it uses a hashing algorithm to place values. It's pretty e

RE: check array element (HELP)

2001-08-01 Thread Wagner Jeff Civ Logicon/TTMS
From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 09:03 To: '[EMAIL PROTECTED]' Subject: RE: check array element (HELP) > -Original Message- > From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 31, 2001 9:44 AM >

RE: check array element (HELP)

2001-08-01 Thread Wagner Jeff Civ Logicon/TTMS
uture adoption of named formal parameters for subroutines, which I read about in the "perlsub" Perl Doc. Thanks again for your time, Jeff -Original Message- From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 12:37 To: [EMAIL PROTECTED] Subjec

Re: check array element (HELP)

2001-07-31 Thread Michael Fowler
On Tue, Jul 31, 2001 at 12:36:37PM -0500, Mooney Christophe-CMOONEY1 wrote: > Oh yeah, and another thing; i think > for (my $i=0; $i<$n; $i++) > is preferable to > for my $i (0...$n-1) > since the latter creates the entire array and then goes through the > elements, instead of merely g

RE: check array element (HELP)

2001-07-31 Thread Mooney Christophe-CMOONEY1
$i++) is preferable to for my $i (0...$n-1) since the latter creates the entire array and then goes through the elements, instead of merely going from one integer to the next. hth! christopher -Original Message- From: Wagner Jeff Civ Logicon/TTMS [mailto:[EMAIL PROTECTED]] Sent: Tu

RE: check array element (HELP)

2001-07-31 Thread Wagner Jeff Civ Logicon/TTMS
} ## Thanks, Jeff -Original Message- From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 08:44 To: [EMAIL PROTECTED] Subject: RE: check array element (HELP) I would probably do this, although i'm sure some smar

RE: check array element (HELP)

2001-07-31 Thread Bob Showalter
> -Original Message- > From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 31, 2001 9:44 AM > To: [EMAIL PROTECTED] > Subject: RE: check array element (HELP) > > > I would probably do this, although i'm sure some smarty-pant

RE: check array element (HELP)

2001-07-31 Thread Mooney Christophe-CMOONEY1
I would probably do this, although i'm sure some smarty-pants could come up with a one-liner ;) sub repeated_elements { my %found_one; for (@_) { return 1 if $found_one{$_}++; } return 0; } if (repeated_elements @whatever) { # ther