This will not always work correctly without knowing a little more about the data.

For example in your code, it will print success if $d='de' and $e = '' even though it should print false according to the OP's original intent. Depending on what you know about the data, that will be in those variables however, you could probably do what you are intending, but joining both sides with a common delimiter and then comparing them. For example:

if ( join("->",$a,$b,$c,$d,$e) eq join '->',qw(a c c d e)) { print "success\n"; } else { print "failure\n"; }

-enlil


In reply to Re^2: Multiple check in If statement ?? by Enlil
in thread Multiple check in If statement ?? by PonGopi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":