in reply to Which loop should I use?
# $dynamic declared prior my $start = 0; my $end = 10; for my $cnt ($start .. $end) { # for my $cnt (0..10) { print "We are on loop # $cnt\n"; print "$dynamic\n"; }
Update: Once again, I am too slow. If this keeps up, you can start calling me Slowpoke Rodriguez!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Which loop should I use?
by coldfingertips (Pilgrim) on Jul 31, 2003 at 18:52 UTC | |
? I'm doing what you showed as an example and I get:
| [reply] [d/l] [select] |
by tedrek (Pilgrim) on Jul 31, 2003 at 19:16 UTC | |
Well I got interested in this problem, So here's a replacement :). I dropped HTML::Tree because I thought it would be nice to be able to have the full text of messages and it was much simpler to just grab straight from the HTML. It should be trivial to run the message text back through HTML::Tree to strip the HTML. I had originally tried tackling this using the parse tree but the code was twice as long and uglier, not to mention it didn't work :(. I created a get function that grabbed off local disk so I didn't have to hit the website whenever I wanted to test. And on to the code!: Read more... (3 kB)
Update: Everything that isn't struck out :) Update2: Added a few linebreaks so one line of code wouldn't wrap | [reply] [d/l] |
by coldfingertips (Pilgrim) on Aug 01, 2003 at 06:44 UTC | |
And I cannot use your script for anything but reference because there are many things within your version that I don't understand (most of your script actually). Using HTML::Tree the code may not have been perfect but I understood all of what I was trying to do. I will definitely keep this script and I will try to work out the bugs. Thanks! | [reply] [d/l] |
by tedrek (Pilgrim) on Aug 01, 2003 at 16:46 UTC | |
by tadman (Prior) on Jul 31, 2003 at 19:13 UTC | |
There's no need to have an independent $cnt when you can use that name as the looping variable. Also, what's wrong with that output? Maybe you could check that the page is loading properly, for example, by testing defined($content) && length($content) | [reply] [d/l] |