in reply to Function not being called

Your shell is lying to you, observe
C:\>perl -le"print qq!hello \rgoodbye!" goodbye C:\>perl -le"print qq!hello \rgoodbye!" |cat -v hello ^Mgoodbye^M C:\>perl -le"print qq!hello \rgoodbye!" |od -tx1 0000000 68 65 6c 6c 6f 20 0d 67 6f 6f 64 62 79 65 0d 0a 0000020