in reply to Re: My array element won't print outside a loop
in thread My array element won't print outside a loop

Basically i want to write the content of the first link i have into the first element of the array, my array starts from 0 and then i want to check another URL and write that URL's contents into the next element so that would be stripped_html1. Am not quite sure what you get when you run the program with the print statement inside and outside the loop but i think you get what you want when its inside and nothing is written when its outside. I dont want to have an element of the array for every word.Hope this helps.
  • Comment on Re^2: My array element won't print outside a loop

Replies are listed 'Best First'.
Re^3: My array element won't print outside a loop
by GrandFather (Saint) on Aug 09, 2005 at 18:34 UTC

    broquaint's reply is what you want then. You could write it as:

    $stripped_html[$urlNum] .= $parser->get_trimmed_text() . "\n" while $p +arser->get_tag;

    where $urlNum is incremented for each URL

    Note that the code that I gave in my first reply puts one line in each element - not one word in each element.


    Perl is Huffman encoded by design.