>>>>> "Cédric" == Cédric Avena <[EMAIL PROTECTED]> writes:

Cédric> An extract of my program:
Cédric> %toto = ( "001" => 1, "002" => 2, "003" => 3 );
Cédric> %tato = ( "004"=> 4, "002"=> 5, "005"=> 6 );
Cédric> $rech = {};

This $rech variable is unused in the rest of your code.  "use strict"
is your friend.  use "use strict".

Cédric> $nb = 2;
Cédric> for $mot (keys %toto) { $rech{$mot} = 1; }
Cédric> for $mot (keys %tato) { if (defined $rech{$mot}) { $rech{$mot}++; } }
Cédric> $recherche = "";
Cédric> for $mot (keys %rech) { if ($rech{$mot}==$nb) {  $recherche .=
Cédric> "'$mot',"; } }
Cédric> chop($recherche);

Cédric> $recherche equals "'002'" with single perl programming
Cédric> $recherche equals "" with ASP programming

It's quite possible that %rech is retaining its value from previous hits,
and therefore counting up hire, or something.  I dunno.  As soon as you have
"use strict"-able code that exhibits the same behavior, let us know.


-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to