Menu

PERL file wrapped in a BAT file

AndyS01
2007-01-02
2012-11-13
  • AndyS01

    AndyS01 - 2007-01-02

    I have many script files that are really PERL file wrapped in .BAT files, and I would like NPP to recognize them as PERL files when it loads them.  Currently, NP++ sees them as .BAT files and sets the language to BATCH, and I have to manually set it to PERL.

    The files all have the same format:
       @echo off
       perl -S -x %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
       goto done
       <perl code goes here>
       __END__
       :done

    Is there some way I can get into the filetype recognizing code to set the language to PERL if it sees a file with an initial "@echo off" line followed by a "perl ..." line?

     
    • AndyS01

      AndyS01 - 2007-01-17

      I set it to recognize all .bat as Perl, and I'm satisfied with that (I don't edit many pure Batch files anyway).  Thanks

       
    • Isaac

      Isaac - 2007-01-04

      Potential alternatives:
      - set it to recognize all .bat as Perl
      - manually select the language