Re: error printing page using LWP::Simple



Gunnar Hjalmarsson wrote:

Tim Greer wrote:
Larry Gates wrote:
On Thu, 05 Feb 2009 20:50:36 -0800, Tim Greer wrote:
You'll need to use $t = (get $url or
"value"); instead -- that does work after trying.

Works? Well, sort of. It assigns "value" to $t if $url does not
contain a true value, but if $url contains a true value,

That was in reply to someone that suggested get $url or "error", which
wouldn't work unless you put parenthesis. That's why I said "If you
use that, you could do this..."

my $t = get ($url) or "error"; would make more sense.

it does not
tell whether the get() function succeeds or why it fails.

Right.

You can also use:

my $t = get $url || "There was a problem";

Same objection.


True.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
.



Relevant Pages

  • Re: Arrays instead of files into hashes
    ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ... terminology extraction for linguistic purposes. ... little script and the output is an array which I can display in a file ...
    (comp.lang.perl.misc)
  • Re: Need help on AoH or array or any other think that might help!
    ... of foreach), but it will run. ... understand the issue now that you've seen the code this was in response ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Newbie php problem
    ... Please forget the first part of the script, as I do put some extra ... accepting input, ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (alt.php)
  • Re: Date/Time module
    ... possible the calculations don't lend themselves to a super efficient ... but I'm betting they do. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Favorite object-oriented modules?
    ... Programming in Perl? ... developing with other people that do go crazy and not CPAN modules. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)

Loading