I sort of agree in the case of fairly trivial code like this. However the OP didn't use strict so the sample should, and when we say "always use strictures" then don't it weakens the argument a little.
Note too that this is not a "code snippet", but a full working script that demonstrates the OP's issue. <toungfirmlyincheek>Surely any complete application should include strictures?</toungfirmlyincheek>
DWIM is Perl's answer to Gödel