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

Creating a directory and then writing files to it.

Thread Next
From:
Tara Calishain
Date:
April 27, 2002 22:25
Subject:
Creating a directory and then writing files to it.
Message ID:
5.1.0.14.2.20020428012028.01e4fbf0@pop.mindspring.com
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:
directorya/directoryb/

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.

Thanks,

Tara




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About