Link to home
Start Free TrialLog in
Avatar of Cosine_Consultants
Cosine_Consultants

asked on

Syntax Question


Do you know what is going to be the result of the line below ?

  $h[$z1][$z2]=$h[$z2][$z1]=$count ;
ASKER CERTIFIED SOLUTION
Avatar of manav_mathur
manav_mathur

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kandura
kandura

it assigns $count to two elements in the array @h, at positions (z1, z2) and (z2, z1).

use Data::Dumper;
$z1=1; $z2=3; $count = 2;
$h[$z1][$z2]=$h[$z2][$z1]=$count ;
print Dumper(\@h);
$VAR1 = [
          undef,
          [
            undef,
            undef,
            undef,
            2
          ],
          undef,
          [
            undef,
            2
          ]
        ];