XP is just a number | |
PerlMonks |
Strange characters encountered in refactoring perl programby redhotpenguin (Deacon) |
on Feb 17, 2005 at 06:21 UTC ( [id://431848]=perlquestion: print w/replies, xml ) | Need Help?? |
redhotpenguin has asked for the wisdom of the Perl Monks concerning the following question:
Esteemed Monks, I have spent the past couple hours banging my head up against this problem. I was refactoring a perl program I downloaded to generate visual diagrams from a database, and introduced Pod::Usage into the mix to clean things up. When it didn't work for verbosity levels 0 and 1, but worked for verbosity level 2, I made a copy of the original file, and then stripped out everything except the pod, and the Pod::Usage code. Convinced I was inept or losing my mind, I tried it with different perls, and different platforms, and still the problem persisted. As a last ditch effort I opened up a new text editor, copied the contents into the editor, and saved the file. Lo and behold it worked! Upon using the system command 'ls -al' to inspect both files, I found that the original file was 16 bytes larger, so something is in there but is not showing up in my vi editor. Stepping through the calls to Pod::Usage with the perl debugger lead me to Pod::Parser line 1067: $textline = $self->preprocess_line($textline, ++$nlines); The original file $textline contained "#!/usr/bin/perl\cM\cJ", while the copy I created had the expected "#!/usr/bin/perl". Every line in the original file had that '\cM\cJ' string appended to each line. I've dealt with CRLF problems before, but what kind of control characters are these (if that's what they are), and why is it that I could only find them using the perl debugger? Thanks in advance for any advice, and read more for the content of the program I ended up with before stepping into the debugger.
Back to
Seekers of Perl Wisdom
|
|