cannot create file within while loop 
Author Message
 cannot create file within while loop


Quote:
> open(MF,"$opt_m");  

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check of the return value of open. But I know
that's not the problem here. Or is it? :-)

Quote:
> while (<MF>) {

   ...

Quote:
>     open(OF,">/tmp/dclause.tmp") or die "Cannot open output
> /tmp/dclause.tmp: $!\n";
> }

Now, you know that you're overwriting that file each time through the
loop, right? Is the problem that it's not created, or that it's empty? If
it's empty, the I don't see what the problem is. :-)

Good luck!

--
Tom Phoenix           http://www.*-*-*.com/ ~rootbeer/

Randal Schwartz Case:   http://www.*-*-*.com/
              Ask me about Perl trainings!



Fri, 25 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. writing to a file within a loop

2. Find and replace in a file within a while loop

3. Reading lines of a file within a loop?

4. Creating an array of files within a directory.

5. Creating a text TMPFILE file from a loop

6. Creating and writing new file from within prog.

7. Creating a new empty file from within Perl..

8. Trouble creating tar file from within my script

9. Looping thru array to create file....

10. Help: a beginner cannot make for/foreach loop running

11. Perl 5.001 cannot return list from inside while loop

12. Cannot Decrement in For Loop?

 

 
Powered by phpBB® Forum Software