Guest User

Untitled

a guest
Apr 10th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.60 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2.  
  3. use strict;
  4.  
  5. use Net::SSLeay qw(get_https post_https sslcat make_headers make_form);
  6. use MIME::Base64;
  7.  
  8. my ($page,$result,$headers,$user,$pass,$srv,$path);
  9.  
  10. $srv='my.example.com';
  11. $path='page.html';
  12. $user='foo';
  13. $pass='bar';
  14.  
  15. ($page, $result, %headers) = get_https($srv, 443, $path,
  16.                 make_headers(Authorization =>
  17.                     'Basic ' . MIME::Base64::encode("$user:$pass",'')
  18.                 )
  19.             );
  20.            
  21. print $page;
  22.  
  23.  $ perl get_html_2.pl
  24. Global symbol "%headers" requires explicit package name at get_html_2.pl line 15.
  25. Execution of get_html_2.pl aborted due to compilation errors.
Add Comment
Please, Sign In to add comment