l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 Jul 01 17:58

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Getting https with perl
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Getting https with perl

Hi All,

I'm trying to get https pages with perl.  

A previous msg [1] led me to install 
Crypt-SSLeay and OpenSSL, which went good.

Now I've got code that looks bad and works

  my $ua = LWP::UserAgent->new( timeout => 20, )
	|| die "Cannot create new LWP UserAgent: $! \n";
  my $req = HTTP::Request->new('GET', $url )
	|| die "Cannot create LWP Request: $! \n";
  $ua->request($req, \&callback, $block )
	|| die "Cannot request data: $! \n";

  sub callback
	my ($html, $response, $protocol ) = @_;
	$html =~ s/^<html>.*Synopsis//;
	print LOG "\n\t html: \n $html \n";
	my @tr = $html =~ /<tr>.*?<\/tr>/gis;
	print LOG "\t Table rows: \n", join("\n", @tr),

The code gets delivered in chunks, so the print
statements are repeated.  Setting $block to 50k
(bigger than the page) did not help.

I'd prefer a simple assignment of the html 
to a scalar, like lwp::simple get does for 
http pages.  But my attempts with that approach 
all end with a hash reference printed.



Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.