lundi 19 mars 2018

Perl equal variables not triggering IF condition

I have been writing in perl for a month or so now, and for some reason I am running into this road block where my IF condition isn't being met. I am comparing the size of an array to a variable that has a clear integer value. I'm fairly new to Perl, but have previous programming experience in different languages and I have never seen this before. Can anyone help me with what I may be missing?

Code:

         print "count = $l : array size: ",  scalar @array_ref,"\n";
         if($l == scalar @array_ref){
               "print why isn't this working?!\n";
         }
         $found = 0;

The output:

count = 59 : array size: 59

Aucun commentaire:

Enregistrer un commentaire