Sorry everyone, I posted messed up code (that's what happens when I try to manage my site and code through my smartphone!

The code below is what I'm actually using.
!/usr/bin/perl BEGIN { my $base_module_dir = (-d '/home/askk/perl' ? '/home/askk/perl' : +( getpwuid($>) )[7] . '/perl/'); unshift @INC, map { $base_module_dir . $_ } @INC; } use warnings; use strict; use CGI qw/:simple/; use CGI::Carp qw(fatalsToBrowser); print header; print "test"; use WWW::Mechanize; my $username = 'admin'; my $password = ''; my $url_to_sign_on = 'http://www'; my $post_new = 'http://www.'; my $mech = WWW::Mechanize->new(); $mech->get($url_to_sign_on); $mech->submit_form( form_name =>'loginform', fields => { user_login => $username, user_pass => $password, } ); ###### # get html for page after sign on ###### my $page_source1 = $mech->content; if ($page_source1 =~ m/dashboard/i) { print "Sign on successful.<br><br>"; } else { print "sign on failed.<br><br>"; exit; } ##### # load page to post new post ##### $mech->get($post_new); if ($post_new =~ m/log out/i) { print "Post_new page loaded successfully.<br><br>"; } else { print "Post_new page failed to load.<br><br>"; exit; } ##### # Fill out the post form ##### $post_new =~ m#name\=\"_wponce\"\s+value=\"([a-z][0-9]){10}\"#i; print "found $1"; exit; $mech->submit_form( form_name =>'post', fields => { '_wpnonce' => '', '_wp_http_referer' => "/wp-admpin/post-new.php", parent_id => '0', user_ID => '1', action => 'editpost', originalaction => 'editpost', post_author => '1', post_type => 'post', original_post_status => 'auto-draft', referredby => 'http', '_wp_original_http_referer' => '_wp_original_http_referer', auto_draft => '1', post_ID => '', autosaveonce => '', 'meta-box-order-nonce' => '', } ); { print "sign on failed.<br><br>"; exit; } ##### # load page to post new post ##### $mech->get($post_new); if ($post_new =~ m/log out/i) { print "Post_new page loaded successfully.<br><br>"; } else { print "Post_new page failed to load.<br><br>"; exit; } ##### # Fill out the post form ##### $post_new =~ m#name\=\"_wponce\"\s+value=\"([a-z][0-9]){10}\"#i; print "found $1"; exit; $mech->submit_form( form_name =>'post', fields => { '_wpnonce' => '', '_wp_http_referer' => "/wp-admin/post-new.php", parent_id => '0', user_ID => '1', action => 'editpost', originalaction => 'editpost', post_author => '1', post_type => 'post', original_post_status => 'auto-draft', referredby => 'http', '_wp_original_http_referer' => '_wp_original_http_referer', auto_draft => '1', post_ID => '', autosaveonce => '', 'meta-box-order-nonce' => '', } );

In reply to Re: internal server error- cant find error by Anonymous Monk
in thread internal server error- cant find error by Anonymous Monk

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.