Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: lwp::simple basic question about webbing

by ichimunki (Priest)
on Jan 18, 2001 at 00:15 UTC ( [id://52593]=note: print w/replies, xml ) Need Help??


in reply to lwp::simple basic question about webbing

In addition to following merlyn's advice about switching to a different module, I'd suggest using something like
my $a = get( $url ) || "get $url failed"; or my $a = get( $url ) or die "Couldn't get() $url: $!";
The scalar is probably better to assign a blob of text info to. With the || operator, your variable is guaranteed to at least contain something-- if not the HTML, then an error message (since if get fails, it returns undefined). With the "die" message, your program stops altogether with an informative message-- probably better unless dying is not at all an option.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2025-03-26 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (68 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.