#!/usr/bin/perl use strict; use warnings; my $icon_loaded; sub BEGIN { $icon_loaded=0; eval { use Text::Iconv; }; $icon_loaded=1 unless($@); } my $input=q(NUR EIN TEST); my $conv_from='RABBLE'; my $converter; if($icon_loaded) { eval{ $converter = Text::Iconv->new($conv_from, "UTF-8"); }; #warn($@) if($@); } print "INIT DONE\n"; if($converter) { $input=$converter->convert($input); print "CONVERT DONE\n"; } else { print "NOT CONVERTED\n"; } print "RUNN DONE\n"; print "OUT: $input\n";