I have a scalar and there is an unwanted blank charachter sitting at the end of it. It was pulled from an input file and as I read in the file I have to grab specific data and place in a scalar to process but each time it's pulled it has this unwanted charachter. Torjanwarblade provided this nice regex to determine the unwanted charachter:
$item =~ s/(\W)/"<".ord(qq:$1.">"/ge;
print "$item\n";
$item prints out as:
data<160>
data<160>
So the unwanted charachter is a 160, I take it hex 160 and possibly a ??
Anyway, I have tried dozens of ways to eliminate this without success including:
$item =~ s/[\r\n]?$//;
$item =~ s/[\x*\f*\e*\t*]$//g;
$item =~ s/\x160$//g;
Is there a way to utilize the code Trojan provided, capture the unwanted and remove, whether it's 160 or some other unwanted ?
Thanks fo any help.
$item =~ s/(\W)/"<".ord(qq:$1.">"/ge;
print "$item\n";
$item prints out as:
data<160>
data<160>
So the unwanted charachter is a 160, I take it hex 160 and possibly a ??
Anyway, I have tried dozens of ways to eliminate this without success including:
$item =~ s/[\r\n]?$//;
$item =~ s/[\x*\f*\e*\t*]$//g;
$item =~ s/\x160$//g;
Is there a way to utilize the code Trojan provided, capture the unwanted and remove, whether it's 160 or some other unwanted ?
Thanks fo any help.