Combining "my" and "if" should issue a warning from the compiler. It's a gotcha, it's not intuitive behavior, and -- judging by how often it comes up on Perlmonks -- catches many otherwise able coders unawares.
Comment on Re: "if" in a my declaration statement causes problem
It should, yes. But don't expect it to in any 5.8.x release. The maint pumpking is very cautious about adding new warnings, and for a while there were a number of people advocating