Re: Sort uniq

2006-10-19 Thread Dr.Ruud
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 = {

Re: Sort uniq

2006-10-18 Thread Rob Dixon
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

Re: Sort uniq

2006-10-18 Thread Paul Johnson
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

Re: Sort uniq

2006-10-18 Thread Shiping Wang
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

Sort uniq

2006-10-18 Thread Johnson, Reginald \(GTI\)
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