Suggestion:
- Carefully read the error message,lines 21-22 of the cmd output.
- search, google, read perls documentation, threads here pertaining to defined and undef
- apply knowledge gained in 2 to error in 1
- fix the code shown
If you didn't program your executable by toggling in binary, it wasn't really programming!