in reply to WWW Scripter update_HTML not working

Someone may guess at an answer... but it would be much easier for those of us not gifted with psi powers if you were a bit more specific about (among other things):
Come, let us reason together: Spirit of the Monastery
  • Comment on Re: WWW Scripter update_HTML not working

Replies are listed 'Best First'.
Re^2: WWW Scripter update_HTML not working
by Anonymous Monk on Feb 02, 2014 at 22:28 UTC
    OK. I'm using a Mac, OS 10.9.1. Perl 5 version 16.2.

    The following code works fine:
    use WWW::Mechanize qw(!update_html);

    $w = new WWW::Mechanize;
    $w->get("file:hello.txt");
    $html = $w->content;
    $html =~ s/Hello World/Goodbye Everyone/isg;
    $w->update_html( $html );
    print $w->content;

    it picks up a file containing the worlds "Hello World" and prints "Goodbye Everyone"

    If I change the WWW::Mechanize to WWW::Scripter, thus:
    use WWW::Scripter qw(!update_html);

    $w = new WWW::Scripter;
    $w->get("file:hello.txt");
    $html = $w->content;
    $html =~ s/Hello World/Goodbye Everyone/isg;
    $w->update_html( $html );
    print $w->content;

    The result is, "Hello World" is printed. Hence I'm assuming the update_html in WWW::Scripter doesn't function incorrectly.

    Thanks for your interest.