$step should be $steps. As
jwkrahn pointed out, if you enabled the warnings and strict pragmas, then you would have seen this error.
Also, please see how to use
open with 3 arguments properly. And you should add 'or die ... ' on your 'open' line so that you know that there are errors when your script cannot open the file properly.