Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Cool Uses, re-used

by elwarren (Curate)
on Nov 15, 2004 at 20:20 UTC ( #407948=note: print w/ replies, xml ) Need Help??


in reply to Cool Uses, re-used

the for loop could be rewritten as:

my $path = "http://www.perlmonks.org/?node_id=1044;next="; foreach my $i (0..20) { my $url = $path . 15 * $i; }
Going over 300 doesn't error out, it returns empty and prompts for a new node. So I'm not sure how you could do a while construct unless you checked the page length returned, and saw it was smaller than a page with listings.

You may prefer using the print format instead of standard layout by adding displaytype to your url  http://www.perlmonks.org/?displaytype=print;node_id=1044;next=100

As the others have said, you shouldn't pound on the server, and you really should use the is_success(get($url)) before concatenating to your file. And you're not going to get any of the "Read More..." text from these either.

But it's interesting :-) I read through all the CUFP when I first discovered Perl Monks.

Cheers


Comment on Re: Cool Uses, re-used
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2015-07-05 19:35 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 (67 votes), past polls