Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by broquaint (Abbot)
on Aug 09, 2005 at 10:58 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-18 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found