in reply to Perl not printing any special characters in array

I think that your problem is that you're re-creating the file for every line.

Try moving the "open HTML" line out above the loops...

# You don't want to do this for each line! open HTML ">C:/Users/jk/Desktop/fun/perl/$site.html"; foreach(<@node>) { $death=$_; print HTML "$death\n"; }

Mike

Replies are listed 'Best First'.
Re^2: Perl prints only last line of array
by myfrndjk (Sexton) on Jun 22, 2014 at 10:51 UTC

    Hi Mike, Thanks for your help ! I modified the code as you suggested it works fine.But now i have another issue .The crawl content doesn't contain any special characters.All special characters are replaced by some junk values. for example (€)euro is printed as (-aA). I am scraping the site which is full of special characters and German language. most of the crawled content are different from original content. Thanks again, jk