home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / perl / 7651 < prev    next >
Encoding:
Text File  |  1993-01-02  |  1.2 KB  |  29 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!think.com!enterpoop.mit.edu!senator-bedfellow.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!aeichsta
  3. From: aeichsta@athena.mit.edu (Andrew J. Eichstaedt)
  4. Subject: Copying files; system and exec for MS-DOS perl?
  5. Message-ID: <1993Jan2.220240.16046@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: e40-008-12.mit.edu
  8. Organization: Massachusetts Institute of Technology
  9. Date: Sat, 2 Jan 1993 22:02:40 GMT
  10. Lines: 17
  11.  
  12. I'm using Len Reed's version of Perl for MS-DOS.  I wanted my perl script
  13. simply to copy a file to another, new file.
  14.  
  15. * I couldn't find a perl copy function to copy files, the same way rename()
  16. renames files, or unlink() deletes files.  Am I missing something obvious?
  17. (I've just started using perl.)
  18.  
  19. * Failing a built-in copy function, I thought I could do something like
  20. system("copy $oldFile $newFile").  However, I can't seem to get system or
  21. exec working in the version of perl I'm using.  A line like
  22. perl -e "system('dir')" seems to do nothing in the DOS version, whereas 
  23. perl -e "system('ls')" gives a directory (as I'd expect) when I try it on a
  24. Unix machine.  Again, am I missing something obvious?
  25.  
  26. Thanks for your suggestions.
  27.  
  28. Andrew Eichstaedt
  29.