you should also take a look at WWW::Mechanize and WWW::Mechanize::FormFiller and WWW::Mechanize::Shell just because they make it relatively easy to whip up a script. here's a little script to download router software from Juniper over https.

#!perl use strict; use warnings; $|++; my $user = '*username-here*'; my $pass = '*password-here*'; my $ver = '6.0'; # lazy version matching my $ext = 'tgz'; # pdf|tgz documentation use WWW::Mechanize; use WWW::Mechanize::FormFiller; use URI::URL; my $agent = WWW::Mechanize->new(); my $formfiller = WWW::Mechanize::FormFiller->new(); $agent->env_proxy(); $agent->agent('Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)'); $agent->get('https://www.juniper.net/support/'); $agent->form(2); $formfiller->add_filler( 'USER' => Fixed => $user ); $formfiller->add_filler( 'PASSWORD' => Fixed => $pass ); $formfiller->fill_form($agent->current_form); $agent->submit(); $agent->follow(qr(Download software)); $agent->follow(qr(Encrypted)); my @links; my @all_links = $agent->links(); my @targets = grep { m!\Q$ver! and m!\Q//download.juniper.net/! } map {$_->[0]} @all_links; $agent->follow(qr(Software Documentation: Release \Q$ver\E)); @all_links = $agent->links(); push @targets, grep { m!\Q-comprehensive-index.pdf! or ( m!/download/! and m!$ext$! ) or m!/download/rn-sw-\d+\.pdf! } map {$_->[0]} @all_links; # uncomment line below for testing # print join $/, @targets, ''; exit; my $base = $agent->uri; for my $target (@targets) { my $url = URI::URL->new($target,$base); $target = $url->path; $target =~ s!^(.*/)?([^/]+)$!$2!; $url = $url->abs; print "mirroring $target$/"; $agent->mirror($url,$target); };

In reply to Re: Net_SSLeay help? [ JUNOS https download ] by zengargoyle
in thread Net_SSLeay help? by booter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.