|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: Weird Character in File Makes Perl Think it's EOFby periapt (Hermit) |
| on Oct 17, 2008 at 20:32 UTC ( #717852=note: print w/ replies, xml ) | Need Help?? |
|
You could certainly read the file in using binmode but, as wol noted, you do loose end-of-line handling. Depending on what is happening with your file before the parsing stage, you may want to try preprocessing it before the parse step.
This will rename the original file <yourfile>.orig and change every occurance of a non-word character to a question mark. I am assuming here that you want to retain the relative location of the offending byte. If you don't, simply write s/\W+// instead of s/\W+/?/.
PJ use strict; use warnings; use diagnostics;
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||