Saturday, January 12, 2013

Use Notepad++ as Perl IDE

If you are looking for a fast and small in size text editor as Perl IDE, Notepad++ probably one of the best choice. By default, Notepad++ will not run Perl script within the editor, you need install and configure "NppExec" plugin to allow this.
Follows the below steps:
  1. Install "NppExec" from "Plugin Manager".
  2. After installed the plugin, from "Plugins" menu, choose "NppExec" -> "Execute...".
  3. 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)" 
  4. From "Plugins" menu, choose "NppExec" -> "Advanced Options...".
  5. Check "Place to the Macros submenu" which allows us to execute the script from "Macros" menu.
  6. 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.
  7. 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.
  8. Restart Notepad++.
  9. After restarted, you can execute an opened Perl script by pressing "Ctrl+Shift+B".