Re: Until loop
[email protected] ("Richard Torrens (RiscOS)") Tue, 02 Apr 2002 11:35:58 +0100
| Newsgroups | perl.riscos |
|---|---|
| Message-ID | <[email protected]> |
In article <[email protected]>, Richard Torrens (RiscOS) <[email protected]> wrote: [Snip] > > I would therefore use another method for my "OS code" to communicate > > back to Perl. eg: > > # cut down example - I put in more info in all messages in my "real" > > code > > my $result = ""; > > until ($result eq "Done") { > > open INP, "{os-code} |" or die "Pipe failed"; > > chomp ($result = <INP>); > > close INP; > > } > ATM that's over my head... <Picks up Perl manual and starts reading>. Yes... I clearly need better books on Perl. The ones I have say too little about pipes. The 'fog' above now has a hint of some form, but I really don't understand it. Any help will be appreciated. ATM I have obey files, one on each 'puter, triggered by Organizer, to reset both BlackHoles. Half an hour later, another Organiser alarm fires the daily backup process. There is a second backup process which is on a 14 day cycle, ATM done manually. The idea was to use Perl to detect when the Blackholes were reset and to trigger both backup cycles. It's clearly not easy. If both Blackholes are reset together then it's indeterminate when the network's going to be ready again, but if I reset sequentially, then the one which starts first should be able to tell the parent process when it's finished - as now the network will be live again. The second reset can start the daily backup process and when this ends the calculated 14 day cycle can be run. Blackhole doesn't unset its variables when it quits. The idea was to unset something in the obey file and detect when this was reset. But this is problematical - really I should also climb inside Blackhole's RunImage and do things there, but that's not easy as it's compressed Basic. -- ------------------------------------------------------------------------- Richard Torrens 4QD manufacture speed controllers for battery electric motors. www sites http://www.4QD.co.uk http://www.4QDtec.com http://www.4QD.org All email addresses are copyright. Resale or use on any lists is expressly forbidden ---------- We use a RISC PC 32 bit RISC computer ----------------