Monday, February 23, 2009

How to run wxPerl scripts from Notepad++

Last month, I explained how to launch a Perl script from Notepad++ using the nppexec plugin.
John left a comment asking how to run wxPerl scripts directly from Notepad++.
At the time, I had no idea what wxPerl was.
Now that I have started to work on a GUI implementation of twit.pl, I can finally answer the question:
  • In the Run menu, select the last item: Perl.
    This will start the Perl interpreter and open the GUI application. That's it!
  • There is no shortcut to Run>Perl by default. Here is how to add one:
    Click on Settings>Shortcut Mapper. The following window appears:

    Add Perl entry in Notepad++ shortcut mapper
  • Select the "Run commands" tab and chose your shortcut for the "Perl" command by double-clicking on the Perl line (last one in the table).
  • In this example, I have remapped the Alt+F1 shortcut from the php Search (I also have deleted the php search shortcut by right-clicking on the line and selecting "delete)
I have not found the equivalent feature in Padre.

Perl quote of the day = '

Possible next posts:
  • Improving on twit.pl: using more of the Net::Twitter API
  • Install Google Analytics on your Blogger blog and stats for DLP
  • Improving on twit.pl: Graphical User interface
  • Perl help resources
  • POD

1 comment :

  1. There's actually an even better way to launch a wxPerl script from Notepad++:
    - Create a new shortcut by going in the menu's Run dialog or by typing F5.
    - Then, in the Run... window, type the program to be run as:
    wperl.exe "$(FULL_CURRENT_PATH)"
    assuming wperl.exe is reachable fom the path.
    - You can add a shortcut by clicking on the "Save..." button and assigning the combination of keys that you want.

    When your wxPerl app's main file is in the editor, you just have to use your key combination and the program will run without the DOS console showing up in the background. That's the effect of using wperl.exe instead of perl.exe.

    ReplyDelete