in reply to Viewing metasymbols in output?
And do that substitution like for every metacharacter you want to replace.local $\ = ''; my $filename = "/mydir/myfile"; open FILE, "<$filename" or die "Cannot open $filename for reading\n"; my $file = <FILE>; close FILE; $file =~ s/\t/\\t/g; open FILE, ">$outfilename" or die "Cannot open $outfilename for writing\n"; print FILE $file; close FILE;
The reason to use s/// instead of tr/// is that you are replacing in a 1:n relationship and not the 1:1 that tr requires.
------
/me wants to be the brightest bulb in the chandelier!
Vote paco for President!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Viewing metasymbols in output?
by Hofmator (Curate) on Aug 07, 2001 at 19:52 UTC |