Rob Dixon schreef:
> $uniq{$_} = 1 foreach @holdArr;
I prefer "foreach" to "for", mainly because it is shorter.
Alternative:
@[EMAIL PROTECTED] = (1) x @holdArr;
Test-1:
perl -MData::Dumper -wle'
@keys = qw(a b c) ;
@hash{ @keys } = (1) x @keys ;
print Dumper \%hash
'
$VAR1 = {
Shiping Wang wrote:
At 02:04 PM 10/18/2006, Johnson, Reginald (GTI) wrote:
I am trying to understand this sort and uniq code that a came across in
the archive. This works, but I thought the %uniq would have the sort
and uniqed values. What is needed if I didn't want to print the values
out imme
On Wed, Oct 18, 2006 at 03:04:32PM -0400, Johnson, Reginald (GTI) wrote:
> I am trying to understand this sort and uniq code that a came across in
> the archive.
I don't see anything to do with sort in this code.
> This works, but I thought the %uniq would have the sort
> and uniqe
At 02:04 PM 10/18/2006, Johnson, Reginald (GTI) wrote:
I am trying to understand this sort and uniq code that a came across in
the archive. This works, but I thought the %uniq would have the sort
and uniqed values. What is needed if I didn't want to print the values
out immediatedly but put them
I am trying to understand this sort and uniq code that a came across in
the archive. This works, but I thought the %uniq would have the sort
and uniqed values. What is needed if I didn't want to print the values
out immediatedly but put them in an array or hash?
#!/usr/bin/perl
use strict;
use wa