use warnings; use strict; open outFile, '>', 'test.rsf'; print outFile "ÐÏࡱá >  þÿ\nThis is plain text"; close outFile; local @ARGV = ('test.rsf'); local $^I = '.bak'; while (<>) { chomp; print STDOUT (length $_) . " >$_<\n"; print ">$_<\n"; }