Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 chilling in the Monastery: (9)
As of 2014-07-10 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (197 votes), past polls