use strict;
use warnings;
open OUT, '>', 'delme1.txt';
print OUT <<STR;
The use of the Porter and
Ale is more prevalent in England. In the
United States ½ Old and ½ New Ale is usually used when this drink is
called for, unless otherwise specified.
STR
close OUT;
open IN, '<', 'delme1.txt';
my $str = do {local $/; <IN>};
close IN;
$str =~ s/½/½/g;
print $str;
Prints:
The use of the Porter and
Ale is more prevalent in England. In the
United States ½ Old and ½ New Ale is usually used when t
+his drink is
called for, unless otherwise specified.
as expected using ActiveState Perl v5.8.7 built for MSWin32-x86-multi-thread under Windows XP.
Maybe the file you are using is not the character format that you think it is?
DWIM is Perl's answer to Gödel
|