I want to start Perl scripts with F11 (as I do with Java Programs) but
nothing happens. Is this function already implemented in the plugin?
btw: Why aren't the plugin files not stored on the official download
servers? I'd like to monitor these files so I'll get a notification if
there's a new version but this function is only enabled for officially
released files...
fs
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-05-23
This is how set up Eclipse to run the Perl scripts I'm editing:
1. Go to Run | External Tools | External Tools...
2. Under Configurations, click on Program, then click New
3. Type in a Name (e.g., Perl Script)
4. On the Main tab enter the following information: Location (e.g., C:\Perl\bin\perl.exe), working directory (e.g., C:\Program Files\Eclispe\workspace), and Arguments (e.g., -w ${resource_loc}).
5. On the Common tab, choose Perl as the Run mode, then click External Tools to Display in favorites menu.
6. Choose Apply, then Close
To run a script I'm editing, I simply click on External Tools icon. It's not the same as pressing F11, but it's quick nonetheless.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-11-19
If your running Eclipse on Linux you might want to try:
under Run->external tools->external tools->
on left select Program. Click New. Rename to whatever at top.
Location: /usr/bin/perl (your perl executable)
Working Directory: $HOME/eclipse/workspace (or wherever Eclipse's
workspace directory is)
Arguments: Click on Variables and select ${resource_loc}.
Uncheck Run tool in background if you want.
Click the Common tab. Check External Tools check box under "Display in
favorites menu:"
Click Apply. Click Close. Select perl script to run.
From Run->external tools Select whatever you named the Program.
Output window will appear at bottom after run.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Through Eclipse and the output in the console view:
My inputted text
kalle
eva
Beata
Why are the prints only fushed in the console view at the termination of the program in the Eclipse environment why not as in real?
Are ther afeature i have missed to get things right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When perl is run in a console, it autoflushes STDOUT, but if it thinks its redirected to a file, it doesn't. This makes for better performance, but messes up IDEs.
You could put "$| = 1;" (without the quotes) at the start of your script, that would force autoflush, regardless of whether you're running in the console or not.
Another thing to note is that STDERR and STDOUT outputs seem out of order when used in an IDEs. I have had weird result with that even with autoflush turned on.
-Mathieu
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to start Perl scripts with F11 (as I do with Java Programs) but
nothing happens. Is this function already implemented in the plugin?
btw: Why aren't the plugin files not stored on the official download
servers? I'd like to monitor these files so I'll get a notification if
there's a new version but this function is only enabled for officially
released files...
fs
This is how set up Eclipse to run the Perl scripts I'm editing:
1. Go to Run | External Tools | External Tools...
2. Under Configurations, click on Program, then click New
3. Type in a Name (e.g., Perl Script)
4. On the Main tab enter the following information: Location (e.g., C:\Perl\bin\perl.exe), working directory (e.g., C:\Program Files\Eclispe\workspace), and Arguments (e.g., -w ${resource_loc}).
5. On the Common tab, choose Perl as the Run mode, then click External Tools to Display in favorites menu.
6. Choose Apply, then Close
To run a script I'm editing, I simply click on External Tools icon. It's not the same as pressing F11, but it's quick nonetheless.
If your running Eclipse on Linux you might want to try:
under Run->external tools->external tools->
on left select Program. Click New. Rename to whatever at top.
Location: /usr/bin/perl (your perl executable)
Working Directory: $HOME/eclipse/workspace (or wherever Eclipse's
workspace directory is)
Arguments: Click on Variables and select ${resource_loc}.
Uncheck Run tool in background if you want.
Click the Common tab. Check External Tools check box under "Display in
favorites menu:"
Click Apply. Click Close. Select perl script to run.
From Run->external tools Select whatever you named the Program.
Output window will appear at bottom after run.
Ordinary:
kalle
My inputted text
eva
Beata
Through Eclipse and the output in the console view:
My inputted text
kalle
eva
Beata
Why are the prints only fushed in the console view at the termination of the program in the Eclipse environment why not as in real?
Are ther afeature i have missed to get things right?
Forgot to add the test script.
$hej="kalle";
$ss="eva";
print $hej . "\n";
$hej="Beata";
$gurgel=<STDIN>;
print "$ss\n$hej\n";
Something to do with output buffering.
When perl is run in a console, it autoflushes STDOUT, but if it thinks its redirected to a file, it doesn't. This makes for better performance, but messes up IDEs.
You could put "$| = 1;" (without the quotes) at the start of your script, that would force autoflush, regardless of whether you're running in the console or not.
Another thing to note is that STDERR and STDOUT outputs seem out of order when used in an IDEs. I have had weird result with that even with autoflush turned on.
-Mathieu
Thanks a lot, you are todays hero.
Rapid answer and relevant.
Thanks:
/The Beginner