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".
Hey thanks for this blog post. I was going to use Eclipse or Padre but both are hard to configure and buggy. Notepad ++ is proven and works great so this will help a lot. I got it up and running in min.
ReplyDeletegood job, thanks
ReplyDeleteAwesome. I used to use TextPad for my Perl scripts in Windows because it supported running programs out of the box, but Notepad++ is a lot more powerful. So, cool. :-)
ReplyDeleteIf you use strawberry perl you need use this script:
ReplyDeleteNPP_SAVE
cd "$(CURRENT_DIRECTORY)"
C:\strawberry\perl\bin\perl "$(FILE_NAME)"
thanks
DeleteAny idea why I can not run Perl in debug mode using this approach?
ReplyDeleteWhen I change the command, adding the -d, it fails.
Change the Notepad++ command to:
DeleteNPP_SAVE
cd "$(CURRENT_DIRECTORY)"
NPP_RUN C:\perl\bin\perl -d "$(FILE_NAME)"
This comment has been removed by the author.
ReplyDeleteHi Guys,
ReplyDelete**Please note that the Path is changed when installing notepad++ 64 bit.
NPP_SAVE
cd $(CURRENT_DIRECTORY)
C:\Perl64\bin\perl $(FILE_NAME)
Cheers,
Jay
This is awesome, thank you.
ReplyDeletethankyou so much..thats amazing!!
ReplyDeleteThanks for this. Using instructions elsewhere I was getting an "Invalid argument" error when trying to execute a script. It didn't like the full path to the script. Using "cd $(CURRENT_DIRECTORY)" solved it.
ReplyDeleteApparently, you cannot use something like "perl c:\tmp\myscript.cgi" as an argument. You have to cd to the script directory first then execute it with "perl myscript.cgi"
Thanks so much for the post but when we execute perl script will I get the following everytime? .. sorry I am a newbie
ReplyDeleteNPP_EXEC: "Run Perl"
NPP_SAVE: C:\Users\k\Desktop\Perl_scripts\1.pl
CD: C:\Users\k\Desktop\Perl_scripts
Current directory: C:\Users\k\Desktop\Perl_scripts
C:\Perl64\bin\perl "1.pl"
Process started >>>
Just Started scripting today - Thu Jul 10 21:42:05 2014<<< Process finished. (Exit code 0)
You can disable the internal messages:
DeleteFrom "Plugins" menu -> NppExec -> Check "No Internal Messages".
Awesome post , Instructions and snapshots are very clear to understand.
ReplyDeleteEvery time i execute ,i get an (EXECUTE ) dialogue box opened , with Commands
NPP_SAVE
cd $(CURRENT_DIRECTORY)
C:\Perl64\bin\perl $(FILE_NAME)
I need to click on OK eveytime to execute the program.
Is there any way we can avoid it ?
Thanks in advance....
Great sir
ReplyDeletethank you so much for this excellent post! I am now able to execute perl scripts through notepad++
ReplyDeleteThank you!! When running the perl script shown, why does my result pop up in a DOS window instead of the Console section in Notepad++ like yours?
ReplyDeleterp672u
I'm using notepad++ in ubuntu, unable to get output, it is giving something like
ReplyDeleteNPP_EXEC: "Run Perl"
NPP_SAVE: Z:\home\vinodv\webcrawal\nptest.pl
CD: Z:\home\vinodv\webcrawal
Current directory: Z:\home\vinodv\webcrawal
/usr/bin/perl "nptest.pl"
Process started >>>
<<< Process finished. (Exit code -1)
================ READY ================
Awesome !
ReplyDeleteAfter updating np++, I had to enter all of this again. Is that normal?
ReplyDeleteNot able to see the command "Run Perl" in the shortcut mapper under plugin category.
ReplyDeleteHow to get a shortcut for run?
Hi, I have the same issue. I tried installation with and without %APPDATA% options, but with the same result :(
DeleteI get an error where when I run the script It says Access is Denied in the console box
ReplyDeleteAny Ideas
Thanks a million!
ReplyDelete+1
ReplyDeleteI am able to execute it, but how put break points and debug code using watch window
ReplyDeleteI am the master of perl thanks to this guide.
ReplyDeleteWhat was that web framewrork before php? Bringing it back.
I am the master of perl thanks to this guide.
ReplyDeleteWhat was that web framewrork before php? Bringing it back.
I am the master of perl thanks to this guide.
ReplyDeleteWhat was that web framewrork before php? Bringing it back.
I was refer here to fix and error code 5 and i still get the same problem
ReplyDeleteyou have written an excellent blog.. keep sharing your knowledge...
ReplyDeletePerl Training in Chennai
Perl Certification Course in Chennai
Thankyou so much. You have saved me so much time.
ReplyDeleteSuch a great blog.Thanks for sharing.........
ReplyDeleteGraphic Design Courses in Bangalore
Graphic Design Courses in Pune
Graphic Design Courses in Hyderabad
Graphic Design courses in Kolkata
Graphic Designing in Ahmedabad
Graphic Design courses in Kochi
Graphic Design courses in Trivandrum
Graphic Design courses in Delhi
Graphic Design courses in Gurgaon
This post is so interactive and informative.keep update more information...
ReplyDeletedot net training in Tambaram
Dot net training in Chennai
This post is so interactive and informative.keep update more information...
ReplyDeleteTally Course in Tambaram
Tally course in Chennai