On 6/5/05, Ing. Branislav Gerzo wrote: > Hi all, > > I noticed strange behavior with die; > Here is snippet: > > use strict; > use warnings; > use WWW::Mechanize; > > my $mech = WWW::Mechanize->new(); > $mech->agent_alias('Windows IE 6'); > $mech->get( 'http://www.zoznam.sk' ); > for my $link ( $mech->links() ) { > print $link->url_abs, "\n"; > } > > > This works quite OK, but when I put die; at the end of script it > throws me an error: > Can't locate URI/javascript.pm in @INC (@INC contains: c:/Perl/lib > c:/Perl/site/ > lib .) at (eval 19) line 3. > ...propagated at myscript.pl line 10. > > at line 10 is die; > > Whats going here ? >
I can't reproduce your problem, using perl 5.8.6 on Linux, WWW::Mechanize version 1.12 . The script I'm using (test.pl): ########### begin code use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->agent_alias('Windows IE 6'); $mech->get( 'http://www.google.com/' ); for my $link ( $mech->links() ) { print $link->url_abs, "\n"; } die; ########### end code I'm running it using "perl test.pl". The output from this is: ########### begin output http://www.google.co.il/imghp?hl=iw&tab=wi http://www.google.co.il/grphp?hl=iw&tab=wg http://www.google.co.il/dirhp?hl=iw&tab=wd http://www.google.co.il/advanced_search?hl=iw http://www.google.co.il/preferences?hl=iw http://www.google.co.il/language_tools?hl=iw http://www.google.co.il/intl/iw/about.html http://www.google.com/ncr Died at aaa.pl line 10. ########### end output (the die statement is on line 10). So the problem is: 1. In some other code you didn't show 2. Specific to your OS, Perl version of W::M version I suspect reason 1 is the culprit :) HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>