in reply to Rogue Null (ordinate 0) characters in text files
The reason why your code isn't working is because instead of:if ($line =~ m/([\0-\x8\xb-\x1f\x7e-\xff])/) { print "$line contains illegal character (ord: ", ord($1), ")\n"; }
you really want:@character=split /\.*/; while (@character){
With the original split call, when there's a dot at the beginning of the line the first element of @character is the empty string.@character=split //; # split $_ into single characters while (@character){
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Rogue Null (ordinate 0) characters in text files
by paulnovl (Novice) on May 08, 2008 at 07:18 UTC |