I have a newbie question also. I just would like to know how is it possible to simplify my code with "unless"?unless ($screen{'firefox'}->compare($screen{'chrome'})) { my $diff_file = $screen{'firefox'}->difference($screen{'chrome'}); print '#The images are not the same; see ' . $diff_file . ' for de +tails'. "\n"; `$diff_file`; unless ($screen{'internet explorer'}->compare($screen{'firefox'})) { my $diff_file = $screen{'internet explorer'}->difference($screen{' +firefox'}); print '#The images are not the same; see ' . $diff_file . ' for de +tails'. "\n"; `$diff_file`; unless ($screen{'chrome'}->compare($screen{'internet explorer'})) { my $diff_file = $screen{'chrome'}->difference($screen{'internet ex +plorer'}); print '#The images are not the same; see ' . $diff_file . ' for de +tails'. "\n"; `$diff_file`;
Regards !
In reply to Simplify code in Perl with "unless" condition by Chaoui05
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |