develooper Front page | perl.beginners | Postings from April 2002

Creating a directory and then writing files to it.

Thread Next
Tara Calishain
April 27, 2002 22:25
Creating a directory and then writing files to it.
Message ID:
Hi, it's me again.

I am reading lines from a text file in directory A. From those lines I want 
to generate
files which I want to copy to directory B. Directory B is generated based 
on a variable.

The structure is so:

So I need to do the following things:

1) Make Directory B based on the variable, which seemed to work okay:
$newdir = mkdir ("$DAY$realmonth$realyear");

2) (In a loop)
Read a line from a textfile in directory A, and use that line to generate a 
file which is written
to directory B.

I thought chdir would do the trick, but the files are still being written 
to directory A
despite the fact that directory B appears to have been generated fine.

I think I'm missing something here but I'm not sure what.



Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About