2009/2/21 Rock Lifestyle <[email protected]>: > Hi All, > > I am new to any programming language .I am trying to copy one file > structure. > > I have a folder structures which contains setup files, cleanup files and > test file > > like > /testplan > /testplan/setup > /testplan/cleanup > /testplan/2.1/setup > /testplan/2.1/cleanup > /testplan/2.1/2.1.1/setup > /testplan/2.1/2.1.1/cleanup > /testplan/2.1/2.1.1/2.1.1.1 > /testplan/2.1/2.1.1/2.1.1.1/test > /testplan/2.1/2.1.1/2.1.1.2 > /testplan/2.1/2.1.1/2.1.1.2/test > /testplan/2.1/2.1.2/2.1.2.2/setup > /testplan/2.1/2.1.2/2.1.2.2/test > /testplan/2.1/2.1.2/2.1.2.2/cleanup > /testplan/2.1/2.1.2/2.1.2.3/test > /testplan/2.2/2.2.1/2.2.1.2 > /testplan/2.2/2.2.1/2.2.1.2/test > > I have a file where I have mentioned the test name like > /testplan/2.1/2.1.1/2.1.1.1 > testplan/2.2/2.2.1/2.2.1.2 > > Now I want to create another file structure where it will copy the directory > tree which I have mentioned in the file > Suppose in my file name I have mentioned > > /testplan/2.1/2.1.1/2.1.1.1 > /testplan/2.2/2.2.1/2.2.1.2/ > > Then the script will create a folder > folder/setup > folder/cleanup > /folder/2.1/setup > /folder/2.1/cleanup > /folder/2.1/2.1.1/setup > /folder/2.1/2.1.1/cleanup > /folder/2.1/2.1.1/2.1.1.1 > /folder/2.1/2.1.1/2.1.1.1/test > /folder/2.2/2.2.1/2.2.1.2/test
Most of the heavy lifting with your requirements can be done with File::Find and File::Path. Good luck, Dp. -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
