Cédric Avena wrote:
> 
> Hi,
> 
> I'm using associative arrays in ASP 0.16, but it doesn't work... I have
> taken the same portion of code in a .pl file and execute it, it works...
> 
> Do associative arrays work with modperl ? Could anybody help me ?
> 
> An extract of my program:
> %toto = ( "001" => 1, "002" => 2, "003" => 3 );
> %tato = ( "004"=> 4, "002"=> 5, "005"=> 6 );
> $rech = {};
> $nb = 2;
> for $mot (keys %toto) { $rech{$mot} = 1; }
> for $mot (keys %tato) { if (defined $rech{$mot}) { $rech{$mot}++; } }
> $recherche = "";
> for $mot (keys %rech) { if ($rech{$mot}==$nb) {  $recherche .=
> "'$mot',"; } }
> chop($recherche);
> 
> $recherche equals "'002'" with single perl programming
> $recherche equals "" with ASP programming
> 

Associative arrays are no different in Apache::ASP or mod_perl,
which both end up running perl code as normal.

What might be hanging you up here is how you end up printing
out $recherche ... just try 

  print $recherche;

in your perl ASP code.  If you want to catch subtle errors in 
your programming, try putting "use strict" at the top of your
code, but be prepared to go to your apache error log for
the compile errors.

-- Joshua
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Reply via email to