Posting a short clear represntative sample is to be appluded (or up voted anyway). Posting something untidy and obscure that can not be easily run and doesn't seem to illustrate the issue at hand will not get you the best posible help (the down votes are incedental in that case).
Although it's not clear from your original post, it may be that you were trying to execute several statements when something failed. There are ways to do that as others have mentioned (perhaps omitting the comma operator - see below). But much better is to use an if/else.
Using an if makes it clear that a test is being made and what gets executed as a result of the test. It is easy to add stuff to be executed for the fail or success case without a lot of mental exercise. The code is easier to understand and easier to maintain.
Oh, and the comma operator? I don't recommend it but:
use warnings;
use strict ;
0 or (print 'this'), (print " and that\n");
DWIM is Perl's answer to Gödel
|