> -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:
--- 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[
> -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
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]'
--- 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
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
>
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
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
$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
}
##
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
> -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
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
12 matches
Mail list logo