Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use CGI qw( -utf8 );
- use CGI::Carp qw(fatalsToBrowser);
- use utf8;
- $cgi=CGI->new();
- print $cgi->header();
- $page = $cgi->param('page');
- $root_dir = "/home2/godspla1/public_html/romanian";
- $root_dir =~ s|/$||; #get rid of trailing slash
- open (RESULTS, "$root_dir/$page")
- or die "Can't open results page ($root_dir/$page): $!";
- binmode STDOUT, ":utf8";
- open (my $fh, ">:encoding(utf8)", "$root_dir/temp.txt" ) or die "Can't open file ($root_dir/temp.txt): $!";
- while ( <RESULTS> ) {
- print "ă\n";
- print $fh "ă\n";
- }
- close $fh;
- close RESULTS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement