l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
August 5: Social gathering
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
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
poorly.

  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),
"\n";
    }

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.

Thanks,
Jim

[1]
http://lugod.org/mailinglists/archives/vox-tech/2000-12/msg00085.html



__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
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:
Sunset Systems
Who graciously hosts our website & mailing lists!