Re: Command line options in EPIC (Perl + Eclipse)
by ikegami (Patriarch) on Feb 24, 2009 at 17:17 UTC
|
Here are the steps for the Debug configuration. Same idea for Run configuration.
- Debug it once. This will create a default configuration for it.
- Right-click on file in Project Explorer or Navigator
- Click Debug As
- Click Debug Configurations
- Click Perl Local
- Select the file (should already be done)
- Click Arguments
- Type in the arguments in Program arguments
To set @INC to find your project's modules:
- Right-click on the project in Project Explorer or Navigator
- Click on Properties
- Click on Perl Include Path
- Click on "..."
- Locate the base path of your modules
- Click Add to List (will look something like ${resource_loc:/project/lib})
| [reply] [d/l] [select] |
|
|
Hello.
Is there a way to set @INC for all your projects at the same time (ie a default @INC for all your projects in Eclipse) rather than doing each one seperately?
Cheers.
| [reply] |
|
|
| [reply] [d/l] |
Re: Command line options in EPIC (Perl + Eclipse)
by Bloodnok (Vicar) on Feb 24, 2009 at 16:38 UTC
|
| [reply] |
|
|
I've managed to get a shell interface on my Epic IDE, so that I can run perl code and check output without having to revert to a command line interface. You can pass an argument(s) to your code this was also. Btw, I'm using WinXP with ActivePerl installed.
Here's how its done:
1. Run->External Tools->External Tools Configutations...
'Main' tab:
***********
2. 'Name' field -> enter 'myShell'
3. 'Arguments' field -> enter:
/C "cd ${container_loc} && perl -w ${resource_name} ${input_var1}"
(note, for a full breakdown of the above variables, check out the url 'http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/concepts-exttools.htm')
4. The above variable 'input_var1' is one I created and I'll explain that below
'Common' tab:
*************
5.In the 'Common' tab, ensure the following radio buttons/tick boxes are checked:
- Local file
- Default - inherited (Cp1252)
- External Tools
- Allocate Console (necessary for input)
- Launch in background
'Main' tab:
***********
6. Below the 'Arguments' field, click 'Variables...' button
7. Edit Variables
8. New
9. Enter 'input_var1' in the 'Variable' column and a default value in the 'Value' column'
10. OK, OK..
11. Click 'Apply' and 'Run', and this will pass the value held in 'input_var1' to your code (can process in the usual way by dereferencing @ARGV[]->$ARGV[0])
12. When you want to alter value held in 'input_var1' and hence value passed into your code, do the following:
12a. Window->Preferences
12b. You're now in the 'String Substitution' facility, where you can happily edit and save changes to 'input_var1'
Hope this helps :)
| [reply] |
|
|
Apologies guys, I'll make it more legible:
I've managed to get a shell interface on my Epic IDE, so that I can run perl code and check output without having to revert to a command line interface. You can pass an argument(s) to your code this was also. Btw, I'm using WinXP with ActivePerl installed. Here's how its done:
1. Run->External Tools->External Tools Configutations...
'Main' tab:
***********
2. 'Name' field -> enter 'myShell'
3. 'Arguments' field -> enter:
/C "cd ${container_loc} && perl -w ${resource_name} ${input_var1}" (note, for a full breakdown of the above variables, check out the url 'http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/concepts-exttools.htm')
4. The above variable 'input_var1' is one I created and I'll explain that below
'Common' tab:
*************
5.In the 'Common' tab, ensure the following radio buttons/tick boxes are checked: - Local file - Default - inherited (Cp1252) - External Tools - Allocate Console (necessary for input) - Launch in background
'Main' tab:
***********
6. Below the 'Arguments' field, click 'Variables...' button
7. Edit Variables
8. New
9. Enter 'input_var1' in the 'Variable' column and a default value in the 'Value' column'
10. OK, OK..
11. Click 'Apply' and 'Run', and this will pass the value held in 'input_var1' to your code (can process in the usual way by dereferencing @ARGV[]->$ARGV[0])
12. When you want to alter value held in 'input_var1' and hence value passed into your code, do the following:
12a. Window->Preferences
12b. You're now in the 'String Substitution' facility, where you can happily edit and save changes to 'input_var1'
Hope this helps :)
| [reply] |
Re: Command line options in EPIC (Perl + Eclipse)
by almut (Canon) on Feb 24, 2009 at 17:14 UTC
|
The description ("3. If you wish to pass command-line parameters
to the script or to the Perl interpreter, enter them in the Arguments
tab.") doesn't sound too cryptic to me. I don't have EPIC installed,
but from the description I'd expect to see two textfields/-areas in the
arguments tab... one for your script, and one for Perl itself.
So, I'm wondering what happens with any arguments you enter there?
Are they simply being ignored, or what? Seems like basic
functionality... if it in fact doesn't work, my inclination to spend
more time with the tool would vastly decrease :)
| [reply] |
|
|
I don't have EPIC installed, but from the description I'd expect to see two textfields/-areas...
Your expectations are quite right;-) One area to enter the command line arguments for your program, one area to enter the arguments for Perl. It works quite well and both on Windows and Linux. There are more advanced options and other tabs in this dialog box though.
So, I'm wondering what happens with any arguments you enter there? Seems like basic functionality...
It * is * basic functionality and it works as expected, i.e. the arguments are passed to Perl and the script respectively. It works fine in practice though frankly speaking there is no need to use this functionality. Both on Windows and Linux the command line is more flexible. The only advantage I can think of is that you don't have to switch to another Window if you work from Eclipse/EPIC. It does give some nice other features.
| [reply] |