home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 July / Vpr9807a.iso / dos_text / fixtext.pl < prev    next >
Perl Script  |  1998-05-01  |  379b  |  21 lines

  1. #!/usr/bin/perl
  2.  
  3. # This script adds DOS newlines to the textfile specified on the commandline.
  4.  
  5. if (length($ARGV[0]) == 0) {
  6.     die "You must specify a filename!\n";
  7. }
  8.  
  9. open(ifp,"$ARGV[0]");
  10. open(ofp,">newfile.temp");
  11. while(<ifp>) {
  12.     chop;
  13.     print ofp "$_\r\n";
  14. }
  15. close ifp;
  16. close ofp;
  17. $cmd="mv -f newfile.temp $ARGV[0]";
  18. system($cmd);
  19. print "Conversion complete.\n";
  20.     
  21.