I am trying to call a script that will run every 10 seconds for 1 minute then exit.
This code calls a siebel function that writes to a .txt file. $cmd = '..\\..\\srvrmgr /g apollo.ts.checkpoint.com /e CHK_ENT_PRD /s CHK_SBL_PRD /u xxxxxxx /p xxxxxxxxxxxxxx /c "list tasks for server CHK_SBL_PRD component Email Manager" > ..\\..\\outlook.txt'; $result = `$cmd`; # note back-ticks There are a couple of problems that I am having: 1. The script is never ending. I though "while (1)" is the right way to do this. 2. Every time it runs I get the follow error it never opens another outlook.txt file. so the script continues to read the same txt over and over again. The process cannot access the file because it is being used by another process. I use this function in over scripts that when called from scheduler it will reopen an new txt file but form some reason with in this loop it fails. Any Ideas? Thank you in advance Lance #/usr/bin/perl while (1) { # RUN EVERY 10 SECONDS sleep 10; $cmd=""; $cmd = '..\\..\\srvrmgr /g apollo.ts.checkpoint.com /e CHK_ENT_PRD /s CHK_SBL_PRD /u xxxxxxxxx /p xxxxxxxxxx /c "list tasks for server CHK_SBL_PRD component Email Manager" > ..\\..\\outlook.txt'; $result = `$cmd`; # note back-ticks # OPEN A FILE WITH THE FILEHANDLER open OUTLOOK, "+<..\\..\\outlook.txt" or die "Cannot open email manager $!\n"; # THIS WILL PUT YOU AT ROW 23.---- for(my $i=0; $i<22; $i++){<OUTLOOK>}; $_=<OUTLOOK>; my $line=$_; print "substr($line, 106, 22)\n"; # OPEN LOG TO TRACK open (APPEND, ">>siebel_mail.log") or die "$! error trying to append"; print APPEND "substr($line, 106, 22)\n"; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]