Fellow monks
I have writtent the following program to go through three webpages that have javascript and then to download the third page for further processing.
But on executing the code i am getting the following error.
Can't call method "clone" on unblessed reference at /usr/lib/perl5/site_perl/5.8.0/HTTP/Message.pm line 22.
My program is to obtain the third page and to store it into "cal.html". Could anybody help me out, as to what this error is and how i could rectify it. My code is as follows
#!/usr/bin/perl # Stats.plx use warnings; use strict; use WWW::Mechanize; use File::Basename; use DBI; use Date::Manip; use Template::Extract; use Data::Dumper; my ($agent,$request,$post_args); $agent = WWW::Mechanize->new( autocheck => 1 ); $request = new HTTP::Request('GET' => "http://www.abc.com/ChooseZone.a +spx?type=A"); print "Making HTTP Post Request....\n"; $request = new HTTP::Request('POST' => "http://www.abc.com/ChooseZone. +aspx?type=A" , [ '__EVENTTARGET' => "rdlZone_0", '__EVENTARGUMENT' => "", '__VIEWSTATE' => "dDw0NzUyOTE0NzQ7dDw7bDxpPDE+Oz47bDx0PDtsPGk8MT47 +aTwzPjs+O2w8dDw7bDxpPDA+Oz47bDx0PDtsPGk8MD47PjtsPHQ8O2w8aTwwPjtpPDE+O +z47bDx0PDtsPGk8MT47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8UGxlYXNlIFNlbGVjdCB0aG +UgQ29uc3VsYXIgRGlzdHJpY3QgdGhhdCBjb3ZlcnMgeW91ciBSZXNpZGVuY2U7Pj47Pjs +7Pjs+Pjt0PDtsPGk8MT47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8VFQgU2VydmljZXMgLSBX +ZWIgQXBwbGljYXRpb247Pj47Pjs7Pjs+Pjs+Pjs+Pjs+Pjt0PHQ8O3A8bDxpPDA+O2k8M +T47aTwyPjs+O2w8cDxcPC90ZFw+XDx0ZCB3aWR0aD0nMjUlJ2NsYXNzPSdCb2R5VGV4dC +dcPlw8Ylw+VVMgQ29uc3VsYXRlIENoZW5uYWkgKE1hZHJhcylcPC9iXD5cPC90ZFw+XDx +0ZCBjbGFzcz0nQm9keVRleHQnXD4gQ292ZXJzIHJlc2lkZW50c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VENTTARGET'} = "rdlZone_0"; # was "" $request = new HTTP::Request('GET' => "http://www.abc.com/ChooseVisa.a +spx"); $agent->get("http://www.abc.com/CalendarDisp.aspx", ":content_file" => "cal.html" );

In reply to Error! Clone on unblessed reference by Agyeya

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.