MarkSWarren has asked for the wisdom of the Perl Monks concerning the following question:
Try running this code as
perl program.pl 'http://www.yahoo.com'and it reports success. But, if you run
perl program.pl 'https://www.yahoo.com'we get a segfault. Here's the smallest program we could make that shows this problem. Thanks in advance...
use strict; use threads; use LWP; my $uri; if (@ARGV > 0) { $uri = shift; } my $ua = LWP::UserAgent->new() or die "Can't create ua\n"; if (defined $uri) { print "uri: $uri\n"; my $r = $ua->get($uri); if (not $r->is_success()) { print "GET error on <$uri>...\n" . $r->error_as_HTML() . "\n"; exit(1); } } my $t = threads->new(\&threadedRequestThread) or die "Can't create thread\n"; print "Joining thread\n"; my @ret = $t->join(); print "Thread returned (@ret)\n"; exit(0); # Actual Thread function sub threadedRequestThread { print "Inside threadedRequestThread\n"; return "A list of words"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Segmentation fault using LWP and threads
by Corion (Patriarch) on Nov 12, 2004 at 15:12 UTC | |
by Ray Smith (Beadle) on Nov 12, 2004 at 21:38 UTC | |
by MarkSWarren (Initiate) on Nov 12, 2004 at 22:45 UTC | |
|
Re: Segmentation fault using LWP and threads
by Roger (Parson) on Nov 12, 2004 at 15:13 UTC | |
by MarkSWarren (Initiate) on Nov 12, 2004 at 22:50 UTC | |
|
Re: Segmentation fault using LWP and threads
by BrowserUk (Patriarch) on Nov 12, 2004 at 17:37 UTC | |
by Ray Smith (Beadle) on Nov 12, 2004 at 21:57 UTC | |
by BrowserUk (Patriarch) on Nov 12, 2004 at 22:10 UTC | |
by MarkSWarren (Initiate) on Nov 16, 2004 at 00:46 UTC |