Very polite of you to thank, but please quote *some* relevant context
from the posts you reply to, and put your comments below those
portions: this is considered good practice and greately aids
communication. You'll notice that most of us do, here.
of course! Little question to you more: you suggested:
my $same = 1;
$same = $same && $old_line[$_] == $out_line[$_] for (2 .. 6);
if ($same) { ... }
I changed to:
my $same = 1;
$same = $old_line[$_] == $out_line[$_] for (2 .. 6);
if ($same) { ... }
because I did not understand the use of the second "$same" after "="
Is it really needed?
You're confused by the absence of parentheses. Ask perl:
: gin:~ [14:35:40]$ perl -MO=Deparse,-p -e '$same = $same && $old_line[$_] == $out_line[$_] for (2 .. 6)'
: ;
: ($same = ($same && ($old_line[$_] == $out_line[$_]))) foreach (2 .. 6);
: -e syntax OK
You were probably thinking along the lines of
($same = $same) && ($old_line[$_] == $out_line[$_]))
Michele