Re: Matching strings

2001-06-29 Thread twelveoaks
> Observe, ye doubter: > > $ perl -le '@vars = qw(one two three two); @h{@vars} - (); print > "Duplicate in (@vars)" unless keys %h == @vars; @vars = qw(one two three > four); > @hh{@vars} = (); print "Duplicate" unless keys %hh == @vars' > Duplicate in (one two three two) > $ > > Because.. wh

Re: Matching strings

2001-06-28 Thread twelveoaks
Peter Scott Wrote: > my %h; > @h{@vars} = (); > if (keys %h != @vars) { $youlose = "yes"; } Maybe I'm missing something - won't these *always* match, since @vars has been used to create keys %h? It seems that way when I test it. What I want to detect is whether any two of the values within

Matching strings

2001-06-28 Thread twelveoaks
I have a series of variables, say, $var0 $var1 $var2 $var3... up to lots and lots depending on user input. They are also available as an array @vars = (element1, element2,...) I want to test to see if any two of their values are identical. Basically if the user has made an