I would suggest $|=1; instead, just because it's a good habit. I've seen moronic situations where $| gets set to -1 (by a previous mistake by another coder) and thus the $|++ I put in place didn't exactly have the desired effect. ;-)
Much better, IMO, to explicitly say what you mean.
Larry Wall is Yoda: there is no try{} The Code that can be seen is not the true Code