Installation
Begin by going to the website for the Padre IDE (padre.perlide.org/). Click on the “Download” link in the top right corner of the page.
Now click on the appropriate download for your operating system. I am using Windows, so the steps that follow will be for installation on Windows. Click on the first link in the “Windows” section of the download page.
This will take you to a page where you can select which version to download. Select the third link file on the page (the first two are for Linux operating systems, and the last one is an older version).
Wait for the download to complete, then run the executable. Follow the steps in the installation wizard to install the Padre IDE. Once the install is complete, open the IDE by clicking on its icon in the Start menu.
The “Hello, World!” Program
Once you have installed Perl (which is included in the Padre IDE’s installation package), it is a good idea to create and run a simple program to confirm that the execution environment has been installed successfully and is working properly. The program traditionally used for this purpose is known as the “Hello, World!” program after the text it prints to the screen.
Padre should have automatically opened a new blank file when you started it. If not, you can open a new file by pressing Ctrl-N. On the first line of the file, type print "Hello, world!\n"; (the \n represents a newline character). Save the file as HelloWorld.plx, and then run it by pressing the F5 key. You should see a black window pop up that contains the text
The contents of HelloWorld.plx together with the output window are shown below:




This is interesting that it outputs straight to the command line, every compiler I've ever used has its own Command output in the compiler itself.
ReplyDeleteI don't know this for certain, but I think it has something to do with the fact that Perl was originally developed for Unix-like systems.
DeleteIncidentally, when I've used C++ in Microsoft Visual Studio, the output from that also popped up in a command window rather than a subwindow within the IDE itself.
Suppose we wanted to save that program instead of interactively running it, is that significantly more complex than the program you have shown us?
ReplyDeleteWe are saving the program. As far as I'm aware, Padre does not provide a way to run code interactively.
Delete