in reply to Re: Perl not printing any special characters in array
in thread Perl not printing any special characters in array

Hi, Thanks for your suggestion,but i don't know where to add those in my code.I tried but still no change in result.can you tell me where to add those encode/decode in my code. Thanks
  • Comment on Re^2: Perl not printing any special characters in array

Replies are listed 'Best First'.
Re^3: Perl not printing any special characters in array
by ww (Archbishop) on Jun 22, 2014 at 19:17 UTC

    Useless reply, myfrndjk; show us the code you "tried" (presumably, 'added') and tell us, in detail, how it failed.

    .

    Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
    1. code
    2. verbatim error and/or warning messages
    3. a coherent explanation of what "doesn't work actually means.

    check Ln42!

      Hi sorry for that reply.I tried "use Encode" and tried to encode "@node". I cant understand these encoding stuffs.After doing this i didnt get any error or warning my logics are working fine but it is not printing special chars example:GRATUITA per gli ordini superiori a €85!

      while(<FILE>) { chomp; $url=$_; foreach ($url) { ($domain) = $url =~ m|www.([A-Z a-z 0-9]+.{3}).|x; } do 'C:/Users/jk/Desktop/perl/mainsub.pl'; &domain_check(); my $ua = LWP::UserAgent->new(agent => "Mozilla/5.0"); my $req = HTTP::Request->new(GET => "$url"); my $res = $ua->request($req); die("error") unless $res->is_success; open my $xp, '>:encoding(UTF-8)', $res; my $xp = HTML::TreeBuilder::XPath->new_from_content($res->content) +; my @node = $xp->findnodes_as_strings(decode('UTF-8',("$xpath"))); $nodedeath="node doesn't exist"; die($nodedeath) if $#node == -1; open HTML, ">C:/Users/jk/Desktop/shippperl/$com.html"; foreach(<@node>) { $death=$_; '>:encoding(UTF-8)', $death; print HTML "$death\n"; } } do 'C:/Users/jk/Desktop/perl/openafilenew.pl'; compare_result(); }