Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: My array element won't print outside a loop

by broquaint (Abbot)
on Aug 09, 2005 at 10:58 UTC ( #482165=note: print w/ replies, xml ) Need Help??


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

You need to append to your array element instead of assigning to it anew in every loop iteration e.g

while($parser->get_tag){ ## Note the . before = and the use of . instead of , $stripped_html[0] .= $parser->get_trimmed_text() . "\n"; } print $stripped_html[0];
See. perlop for more info on the .= operator.
HTH

_________
broquaint


Comment on Re: My array element won't print outside a loop
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://482165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2015-07-30 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls