home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-2.iso / Developer / webobjects / extensions / win-nt / NTPerl5-109.exe / PL2BAT.BAT < prev    next >
Encoding:
DOS Batch File  |  1996-04-16  |  971 b   |  61 lines

  1. @rem = '--*-PERL-*--';
  2. @rem = '
  3. @echo off
  4. rem setlocal
  5. set ARGS=
  6. :loopA
  7. if .%1==. goto endloopA
  8. set ARGS=%ARGS% %1
  9. shift
  10. goto loopA
  11. :endloopA
  12. rem ***** This assumes PERL is in the PATH *****
  13. perl.exe -S pl2bat.bat %ARGS%
  14. goto endofperl
  15. @rem ';
  16.  
  17.  
  18. $tail = "__END__\n:endofperl\n";
  19.  
  20. if ( @ARGV ) {
  21.    LOOP:
  22.     foreach ( @ARGV ) {
  23.     open( FILE, $_ );
  24.     @file = <FILE>;
  25.     if ( grep( /:endofperl/, @file ) ) {
  26.         warn "$_ has already been converted to a batch file!!\n";
  27.         next LOOP;
  28.     }            
  29.     close( FILE, $_ );
  30.     s/\.pl//i;
  31.     s/\.bat//i;
  32.     open( FILE, ">$_.bat" );
  33.  
  34. print FILE <<"--end--";
  35. \@rem = '--*-PERL-*--';
  36. \@rem = '
  37. \@echo off
  38. rem setlocal
  39. set ARGS=
  40. :loop
  41. if .%1==. goto endloop
  42. set ARGS=%ARGS% %1
  43. shift
  44. goto loop
  45. :endloop
  46. rem ***** This assumes PERL is in the PATH *****
  47. perl.exe -w -S $_.bat %ARGS%
  48. goto endofperl
  49. \@rem ';
  50. --end--
  51.         print FILE @file, $tail;
  52.  
  53.     }
  54. }
  55.  
  56. close FILE;
  57.  
  58.  
  59. __END__
  60. :endofperl
  61.