#!/usr/bin/perl
$text = shift;
$from = shift;

open      FILE,$text;  
sysread   FILE,$str,-s FILE;
close     FILE;
#recode
if ($from =~ /win/i)
   {$str =~ tr/[]/[]/ };

if ($from =~ /alt/i)
   {$str =~ tr/[]/[Аѳ]/ };

open      FILE,">$text";
syswrite  FILE,$str,length $str;
close     FILE;
