SHOW:
|
|
- or go back to the newest paste.
1 | use CGI qw( -utf8 ); | |
2 | use CGI::Carp qw(fatalsToBrowser); | |
3 | use utf8; | |
4 | ||
5 | $cgi=CGI->new(); | |
6 | ||
7 | print $cgi->header(); | |
8 | ||
9 | $page = $cgi->param('page'); | |
10 | $root_dir = "/home2/godspla1/public_html/romanian"; | |
11 | ||
12 | $root_dir =~ s|/$||; #get rid of trailing slash | |
13 | ||
14 | open (RESULTS, "$root_dir/$page") | |
15 | or die "Can't open results page ($root_dir/$page): $!"; | |
16 | binmode STDOUT, ":utf8"; | |
17 | open (my $fh, ">:encoding(utf8)", "$root_dir/temp.txt" ) or die "Can't open file ($root_dir/temp.txt): $!"; | |
18 | while ( <RESULTS> ) { | |
19 | print "ă\n"; | |
20 | print $fh "ă\n"; | |
21 | } | |
22 | close $fh; | |
23 | close RESULTS; |