rolltide has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Can't call method "readystate" on an undefined value at C:/Perl/site/lib/Win32/IEAutomation.pm line 562
  • Select or Download Code

Replies are listed 'Best First'.
Re: Can't call method "readystate" on an undefined value at C:/Perl/site/lib/Win32/IEAutomation.pm line 562
by VincentK (Beadle) on Jan 09, 2014 at 20:20 UTC
    Wow, that is a giant blob of ugliness.

    In the future, please put your script code within code tags.

    In the IEAutomation code, it looks like readystate is used in the following subs

    sub WaitforDone{ my $self = shift; my $agent = $self->{agent}; while ($agent->Busy || $agent->document->readystate ne "complete") +{ sleep 1; } } sub WaitforDocumentComplete{ my $self = shift; my $agent = $self->{agent}; while ($agent->document->readystate ne "complete"){ sleep 1; } }

    What is your code for using WaitforDone or WaitforDocumentComplete? Are you passing a var with an undefined value? It sounds like it.
Re: Can't call method "readystate" on an undefined value at C:/Perl/site/lib/Win32/IEAutomation.pm line 562
by toolic (Bishop) on Jan 09, 2014 at 19:10 UTC
Re: Can't call method "readystate" on an undefined value at C:/Perl/site/lib/Win32/IEAutomation.pm line 562
by bcarroll (Pilgrim) on Aug 25, 2014 at 17:01 UTC
    Posting a link to the module page on CPAN is probably a better idea...

    Do you get the same error with the following script?

    use warnings; use strict; use Win32::IEAutomation; my $url = 'http://www.perlmonks.org/?parent=1070018;node_id=3333'; my $ie = Win32::IEAutomation->new( visible => 1); $ie->gotoURL($url); $ie->WaitforDone(); $ie->closeIE();