in reply to Capture string that starts with #

It has nothing to do with myscript.pl and everything to do with calling program, be it the shell or some c program.