Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-11-21 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (104 votes), past polls