I've got a Strawberry Perl program that accepts a single-file as a command-line argument. How can I set things up such that I can drag and drop the desired file onto the Strawberry Perl program (or a wrapper around it) and the program runs with that file's name as an argument?
The first is to create a batch version of the program with pl2bat, which will execute perl with the program. Installed programs usually do this automatically because MakeMaker and Module::Build take care of this. That way, you can call programs just by naming them with the . pl extension.
You can write your scripts inside of Notepad++, but to run, it needs to call the external perl instance. Like the PythonScript or LuaScript plugins, this module is able to automate actions in the Notepad++ GUI, and access and modify the contents of the open files inside Notepad++.
Just open a command prompt (in Windows, just type cmd in the run dialog and press Enter. If you're on a Mac or on Linux, open a terminal window). and press Enter. If Perl is installed, you receive a message indicating its version.
Under Windows (tested with XP), you can create a .cmd file and simply have it run the Perl program with the argument of %1 to pass the filename over, as if executed by commandline.
perl c:\test.pl %1
Then you can simply drag and drop a file onto the .cmd file to execute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With