use utf8::all; while( my $count==0 || ( $count<3 && $@ =~ /does not map to Unicode/ ) ){ print "Trying $encoding[$count] encoding.\n\n"; eval{ $stat=qx#$mplayer_bin_conf -nolirc -vo null -vc dummy -cache $mplayer_cache_size_conf -cache-min $mplayer_cache_perc_min_conf -ao pcm:waveheader:file=$o_tot_cmd $i_file_cmd# }; if( $@=~m#does not map# ){ warn $@; $count++; }elsif( $@ ne '' ){ die $@; # bail out on other eval errors }else{ print "Found: $encoding[$count] .\n\n"; $stat=decode( $encoding[$count], ( qx#$mplayer_bin_conf -nolirc -vo null -vc dummy -cache $mplayer_cache_size_conf -cache-min $mplayer_cache_perc_min_conf -ao pcm:waveheader:file=$o_tot_cmd $i_file_cmd# ) ); last; } } #### utf8 "\xC2" does not map to Unicode at r.pl line 30. Trying cp1251 encoding. utf8 "\xC2" does not map to Unicode at r.pl line 30. Trying koi8-r encoding. Cache not responding! utf8 "\xC2" does not map to Unicode at r.pl line 30. MPlayer interrupted by signal 13 in module: demux_open2 MPlayer interrupted by signal 13 in module: read_subtitles_file