When you install the Perl interpreter, it should automatically associate the .pl filename extension with Perl scripts to be run by the Perl interpreter. You should be able to confirm this with assoc .pl, If it says ".pl=perlscript", check ftype perlscript.

The installer should also add the perl interpreter's location to the command search PATH used by Windows' Command-Prompt.

Perl scripts should be saved in files with a filename extension of .pl.

If all the above is OK, you can run perl scripts by just typing their filename myscript.pl otherwise you have to explicitly tell Windows what interpreter to use: perl myscript.pl or in the worst case C:\strawberry\perl\bin\perl myscript.pl.

thanks for ur reply RedGrittyBrick. i save this script as run2.bat and it come out with error msg ('perl' is not as an internal or external command. this is my script <code>perl -p -i -e "print qq(\n) if $. == 4" C:\Documents and Settings\Mun Kar\Desktop\test1\file1.txt pause <code>
–
newbie18Sep 13 '11 at 8:59

@newbie: Sorry, you need to download and install the Perl interpreter before you can run Perl scripts. What I quoted was a command but it is not hard to make it into the equivalent of a bat file, I'll edit the answer.
–
RedGrittyBrickSep 13 '11 at 9:03

is Perl interpreter is freeware or i need to pay before use?
–
newbie18Sep 13 '11 at 9:09

1

The Perl interpreter is free, there is nothing to pay. If you were in a commercial business context where you needed a commercially supported product, you could buy support from Activestate - they also provide a free version.
–
RedGrittyBrickSep 13 '11 at 9:18

after running, still have error come out '#!perl' is not as an internal or external command. after installed this software
–
newbie18Sep 13 '11 at 9:37