Leser: 16
1 2 3 4 5 6
my $modul = 1; eval "use Text::Iconv; 1;" or $modul = 0; my $converter = Text::Iconv -> new ("CP$codepage",'ISO-8859-1'); if ($modul && defined $converter) { $result = $converter -> convert ($result); }
1 2 3 4 5 6 7
my $modul = 1; eval "use Text::Iconv; 1;" or $modul = 0; my $converter; eval "my $converter = Text::Iconv -> new (\"CP$codepage\",'ISO-8859-1')"; if ($modul && defined $converter) { $result = $converter -> convert ($result); }
Quotefür die zweite eval{} Zeile.Use of uninitialized value $converter in concatenation (.) or string
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#!/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";
2010-03-16T16:42:13 topegCode (perl): (dl )1 2 3 4 5 6 7 8 9 10[...] my $icon_loaded; sub BEGIN { $icon_loaded=0; eval { use Text::Iconv; }; $icon_loaded=1 unless($@); } [...]
1 2 3 4 5 6 7 8 9 10 11
my $icon_loaded; BEGIN { $icon_loaded = 0; if ( eval { require Text::Iconv } ) { #Text::Iconv->import; $icon_loaded = 1; } }
1 2 3 4 5 6 7 8
my $iconv_loaded; sub BEGIN { $iconv_loaded=0; eval('use Text::Iconv'); $iconv_loaded=1 unless($@); }
2010-03-16T18:27:27 MatthiasWNunja, ein use hat wohl keinen Rückgabewert, oder?
1 2 3 4 5 6 7 8 9
#!/usr/bin/perl -w use strict; use warnings; my $modul = 1; #eval "use perl::ist::schön; 1;" or $modul = 0; eval "use Text::Iconv; 1;" or $modul = 0; if ($modul) { print Text::Iconv -> new ('CP850','ISO-8859-1'); }
2010-03-16T18:28:56 biancaOder war etwas anderes gemeint?