Mar 2, 2001, 6:37 PM
Post #2 of 2
When in doubt, put parentheses around just about anything.
But in this case it is safe to leave them out because =~ is stronger than || so it will behave like you want.
The warning I gave about || was in an open statement where because the || is stronger than an 'or' there will be a change to the statement if the parentheses is missing.
These three statements will all do the same thing...
open (DATA, 'filename') || die;
open (DATA, 'filename') or die;
open DATA, 'filename' or die;
But these two statements are different from the first. Without the parentheses around the open statement, the || works on the two things surrounding it. So if you use the first one you are really getting something that behaves like the second one...
open DATA, 'filename' || die;
open DATA, ('filename' || die);
Sun Sep 9, 2001 - 1:46:40 GMT, a very special second in the epoch. How will you celebrate?