CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
mechanise whats wrong with doing this

 



gerble1000
User

May 24, 2012, 2:23 PM

Post #1 of 5 (918 views)
mechanise whats wrong with doing this Can't Post

to start mechanise is noremally this my $mech = WWW::Mechanize->new();
why can i not put this

Code
my $mech = WWW::Mechanize->new(  onerror => {    goto BEGIN  });

so if there is an error it goes back and starts again


FishMonger
Veteran / Moderator

May 24, 2012, 2:42 PM

Post #2 of 5 (917 views)
Re: [gerble1000] mechanise whats wrong with doing this [In reply to] Can't Post

Simple answer, because the module doesn't support it.

Besides that, YOU SHOULD NOT USE goto STATEMENTS!!!!

It is almost never the proper thing to use, so don't use it untl you understand when it would be appropriate and you need its functionality.


gerble1000
User

May 24, 2012, 2:50 PM

Post #3 of 5 (915 views)
Re: [FishMonger] mechanise whats wrong with doing this [In reply to] Can't Post

to be honest my main script has loads of goto's, because i dont know how else to navigate around in perl


FishMonger
Veteran / Moderator

May 24, 2012, 2:56 PM

Post #4 of 5 (914 views)
Re: [gerble1000] mechanise whats wrong with doing this [In reply to] Can't Post

Navigation is normally handled by proper use of conditionals and while loops that execute various subs.


gerble1000
User

May 24, 2012, 3:19 PM

Post #5 of 5 (911 views)
Re: [FishMonger] mechanise whats wrong with doing this [In reply to] Can't Post

i do struggle with getting goto to work properly :(
the thing is i have a script that has all the wrong ways to do things but works ok. just a few teething problems.
i would love to show you the whole script but it violates a few terms and conditions of a couple websites. thats why i am relunctant to show all the code :)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives