Follows the below steps:
- Install "NppExec" from "Plugin Manager".
- After installed the plugin, from "Plugins" menu, choose "NppExec" -> "Execute...".
- Copy the following script and click "Save..." to save it as "Run Perl". Click "OK" to close the dialog.
NPP_SAVE cd "$(CURRENT_DIRECTORY)" C:\perl\bin\perl "$(FILE_NAME)"
- From "Plugins" menu, choose "NppExec" -> "Advanced Options...".
- Check "Place to the Macros submenu" which allows us to execute the script from "Macros" menu.
- Type "Run Perl" in "Item name" text box and associate it with "Run Perl" script, and click "Add/Modify" to create it. menu item. Click "OK" to save the settings.
- Now, assign a shortcut key e.g. "Ctrl+Shift+B" to execute the script. From "Settings" menu, choose "Shortcut Mapper" -> "Plugin commands" tab, select "Run Perl" and click "Modify" to assign "Ctrl+Shift+B" or any preferable key. Click "OK" to save it.
- Restart Notepad++.
- After restarted, you can execute an opened Perl script by pressing "Ctrl+Shift+B".