general retry function

2005-09-27 Thread Ing. Branislav Gerzo
Hi Perlers, I have one nice question for you, I was run into common problem: need to repeat certain number of times something, until is succesful. For example - download webpage, FTP upload, connect to some host and so on. I ask you for some general (or it can't be possible - FTP upload) function,

Re: general retry function

2005-09-27 Thread Chris Devers
On Tue, 27 Sep 2005, Ing. Branislav Gerzo wrote: > Could be anyone so nice and write it ? I'm sure someone *could*, but I wouldn't count on it happening :-) > I have some snippets here, using eval {} and catch errors with calling > recursive sub, but I don't think thats the best option. That'

Re: general retry function

2005-09-27 Thread Wiggins d'Anconia
Ing. Branislav Gerzo wrote: > Hi Perlers, > > I have one nice question for you, I was run into common problem: > need to repeat certain number of times something, until is succesful. > For example - download webpage, FTP upload, connect to some host and > so on. > I ask you for some general (or it

RE: general retry function

2005-09-28 Thread Bob Showalter
Chris Devers wrote: > while ( $tries < 10 ) { > my $result = do_something_risky(); > break if ( $result != 0 ); "last", not "break" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: general retry function

2005-09-28 Thread Chris Devers
On Wed, 28 Sep 2005, Bob Showalter wrote: > Chris Devers wrote: > > while ( $tries < 10 ) { > > my $result = do_something_risky(); > > break if ( $result != 0 ); > > "last", not "break" Whoops! Thank you, yes, use 'last' there. -- Chris Devers Áû}=œX…àÀžÀ -- To unsubscribe, e-m

Re: general retry function

2005-09-28 Thread Ing. Branislav Gerzo
Wiggins d'Anconia [Wd], on Tuesday, September 27, 2005 at 17:51 (-0600) contributed this to our collective wisdom: Wd> You haven't shown us what you have tried, or where it failed, only Wd> suggested something about eval and recursive subs, which neither of Wd> which should be pertinent here. Show