On Wed, 5 Dec 2001, Shinagare, Sandeep wrote:

> #snip1
> system ("copy c:\msg.txt c:\sandeep\msg.txt");
> #end
>
> which works fine. But how can i give it a dynamic file name say like...
>
> #snip2
> $vfilename="TestFile.txt";
> system ("copy c:\msg.txt c:\sandeep\$vfilename");
> #end
>
> this does not work (i mean it does create a file called $vfilename), but
> that is not what i want... It should create a file called "TestFile.txt"
>
> This is using Perl on Win-NT

You should use the File::Copy module for this.  It has functions, cp (and
an alias called copy) that can do the file copy, and you have better
control over the error handling.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
I can't mate in captivity.
                -- Gloria Steinem, on why she has never married.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to