Trihedralguy has asked for the wisdom of the Perl Monks concerning the following question:
I want to try and timeout after like 3 seconds.#Parameters: id, user_id, screen_name, since_id, max_id, count, page eval { my $statuses = $nt->user_timeline({ screen_name => 'username', count + => 4 }); for my $status ( @$statuses ) { my $message = substr $status->{text}, 0, 70; if ($status->{text} ne $message) { $message = $message . '...'; } print $message; } }; if ( $@ ) { if ( blessed $@ && $@->isa('Net::Twitter::Error') ) { #... use the thrown error obj warn $@->error; } else { # something bad happened! warn "Twitter is failing!"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Time Out eval
by Herkum (Parson) on Aug 06, 2009 at 18:24 UTC | |
|
Re: Time Out eval
by bot403 (Beadle) on Aug 06, 2009 at 18:25 UTC | |
by ssandv (Hermit) on Aug 06, 2009 at 19:53 UTC | |
by bot403 (Beadle) on Aug 06, 2009 at 20:28 UTC |