in reply to Re^5: problem regarding the value given in the select box
in thread problem regarding the value given in the select box

<form id="form" action="printChokePoints.php" method="POST" enctype="multipart/form-data"> <script> // The blockUI function doesn't work on IE8 with frames ! We have to // block div $('form').block({ css: { border: 'none', padding: '15px', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: .5, color: '#fff' } }); $(document).ready(function() { $('form').unblock(); }); </script> Select a biosource <select name='org' size=1 onChange='javascript:changeOrg(this.value)'> <option value=''>Select a biosource</option> <option style="color:black;" value=884 >Bacillus anthracis (Strain: Ames Ancestor) MicroCyc</option> <option style="color:black;" value=885 >Bacillus subtilis (Strain: 168) MicroCyc</option> My perl code os
$url = "http://metexplore.toulouse.inra.fr/metexplore/index.php/2011-0 +6-06-14-41- 10/choke-point-reactions"; my $mech=WWW::Mechanize->new(); $mech->get($url); $value ="Bacillus anthracis (Strain: Ames Ancestor) MicroCyc"; #$mech->form_id('form'); $mech->field('org',$value); #$mech->select('org', '?Bacillus anthracis(Strain:Ames Ancestor)MicroC +yc'); $mech->set_fields('org'=>$value); $mech->submit;
but the error is coming "Can't call method "some_method" on an undefined value at -e line 1407."

Replies are listed 'Best First'.
Re^7: problem regarding the value given in the select box
by Corion (Patriarch) on Sep 14, 2013 at 10:01 UTC

    This cannot be the error message you are seeing.

    The script you show does not have 1407 lines. There is no method named "some_method" mentioned in the code you show.

    Please find a colleague near to you and ask them about how to proceed with your problem.

    I cannot help you further unless you show actual effort.

      This 1407 line is in mechanize.pm the complete error is "can't call method on an undefined value at C:/strawberry/perl/vendor/lib/www/mechanize.pm. some_methods was wrongly typed.Plz help me in this regard!!

        You don't tell us which version of WWW::Mechanize you have installed. You could find out the version by running:

        perl -MWWW::Mechanize -e "die WWW::Mechanize->VERSION"

        The most common cause for this is that you did not set the proper form in your script. I notice a commented out line

        #$mech->form_id('form');

        Maybe using the correct form helps. Or maybe there is no form on your page. I think at least version 1.73 of WWW::Mechanize outputs a proper warning instead of crashing the program.