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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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
Potential alternatives:
- set it to recognize all .bat as Perl
- manually select the language