venkatesan_G02 has asked for the wisdom of the Perl Monks concerning the following question:
I am using WWW::Mechanize to automate interaction with a web site. The user has to submit an order number and the web site will return a link to the order if the order exists.
My program is working fine under ideal conditions (i.e) if a link is returned by the web site.
But the program crashes if no link is returned by the web site and WWW::Mechanize returns " Can't call method "url" on an undefined value " error.
I read thru the documentation for the module in CPAN and it is mentioned that follow_link will return undef if no link is found.
I tested for undef and even then the program crashes.
Is there a way to overcome this problem and the program should output a user understandable error which i have give in the program.
Thanks in Advance!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize follow_link() crashes if no link is found
by arkturuz (Curate) on Sep 25, 2009 at 11:47 UTC | |
by venkatesan_G02 (Sexton) on Sep 25, 2009 at 11:54 UTC | |
by almut (Canon) on Sep 25, 2009 at 12:12 UTC | |
by venkatesan_G02 (Sexton) on Sep 25, 2009 at 12:29 UTC | |
by arkturuz (Curate) on Sep 25, 2009 at 12:12 UTC | |
|
Re: WWW::Mechanize follow_link() crashes if no link is found
by merlyn (Sage) on Sep 25, 2009 at 14:30 UTC |