Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I copy/move/delete files in a Windows/DOS Perl script??

Status
Not open for further replies.

huckfinn

Programmer
May 19, 2000
4
0
0
US
Hi,<br><br>Does anyone know how to make a perl script copy/move/delete files in a windows/DOS environment?<br><br>Thanks!<br>Huck<br><A HREF="mailto:huckleberryfinn@beer.com">huckleberryfinn@beer.com</A>
 
To copy and move files use the File::Copy module that has the copy and move modules.<br>i.e.<br><br>use File::Copy;<br>copy(&quot;file.txt&quot;,&quot;file2.txt&quot;);<br>move(&quot;file2.txt&quot;,&quot;..&quot;);<br><br>To delete a file use unlink function.<br>i.e.<br>print 'Deleted ', unlink(&lt;*.old&gt;), ' files.';<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top