Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Re: Setting environment-variables in Eclipse (EPIC)? [SOLVED]

by Aaronrp (Scribe)
on Mar 16, 2011 at 00:57 UTC ( [id://893468]=note: print w/replies, xml ) Need Help??

in reply to Setting environment-variables in Eclipse (EPIC)? [SOLVED]

What I do in Eclipse/EPIC is change the perl executable line.

/ActivePerl/bin/perl -I/Users/apriven/Dev/Source/Actium/trunk -MActium::Eclipse

(Actium is the name of my project)

Then, whatever I want to do in Eclipse, but not when running otherwise, is done in the Actium::Eclipse module.

Here's my Actium::Eclipse module:

# Actium/ # Originally, this did nothing of any use. However, requiring that thi +s file # be present was a cute way of figuring out whether the requiring # program is running under Eclipse or not. # Add -MActium::Eclipse to Eclipse's default perl comamnd line. # Then you can do: # if ($Actium::Eclipse::is_under_eclipse) { # do_something(); # } # else { # do_something_else; # } # Ta da. # Originally, I did that so that could ask for a command lin +e if # none was provided. I later moved that routine to this module. So # Actium::Eclipse::get_command_line() gets the command line (using App +lescript... # slowly) from Eclipse. package Actium::Eclipse; use 5.010; use warnings; use strict; no warnings('redefine'); # without which, Eclipse complains because it sees this module twice w +hen # debugging this module our $is_under_eclipse = 1; sub get_command_line { my $history; if ( -f '/tmp/UnderEclipse.history' ) { open my $histfile, '<', '/tmp/UnderEclipse.history'; $history = readline($histfile); chomp $history; close $histfile; } else { $history = ""; } my $script = qq[osascript -e 'tell application "Eclipse" to get text return +ed of ( display dialog "$0\rCommand line:" default answer "$history" +buttons "OK" default button "OK" with title "Command line entry" ) '] +; my $newargs = `$script`; chomp $newargs; if ( $newargs ne $history ) { open my $histout, '>', '/tmp/UnderEclipse.history'; say $histout $newargs; close $histout; } return split( ' ', $newargs ); } ## <perltidy> end sub get_command_line 1;
-- Am I the only one who still cares about RT #67694?

Replies are listed 'Best First'.
Re^2: Setting environment-variables in Eclipse (EPIC)? [SOLVED]
by sundialsvc4 (Abbot) on Mar 16, 2011 at 15:29 UTC

    I am going to have to “munch on” what you have just said here, for quite some time.   I confess that I do not fully understand it now.   (But, “if Perl hath many mysteries, forsooth, Eclipse hath many more.”)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://893468]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-07-16 06:48 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.