?
Solved

Syntax Question

Posted on 2004-12-01
2
Medium Priority
?
161 Views
Last Modified: 2010-03-05

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

  $h[$z1][$z2]=$h[$z2][$z1]=$count ;
0
Comment
Question by:Cosine_Consultants
2 Comments
 
LVL 16

Accepted Solution

by:
manav_mathur earned 1000 total points
ID: 12714478

a=b=c

implies c will be assigned to b and b will be assigned to a. In your case, it will most prbably incolve cinstruction of a diagonally-symmteric array.

Manav
0
 
LVL 18

Expert Comment

by:kandura
ID: 12714492
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
          ]
        ];
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question