Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Executing a program from within a Perl Module in a non-standard path

by GoldElite (Beadle)
on Mar 20, 2013 at 11:53 UTC ( #1024502=note: print w/replies, xml ) Need Help??


in reply to Re: Executing a program from within a Perl Module in a non-standard path
in thread Executing a program from within a Perl Module in a non-standard path

Ahh, this is pretty cool. I like the idea that System::Sub represents, but alas, it requires that I know where the executable (or script!) will be at compile time (at least, relative to the cwd).

As an aside, I can't understand how import doesn't get itself in an infinite loop! Where's the exit?!

 

But thanks; I'll definitely keep this class in mind for later projects

  • Comment on Re^2: Executing a program from within a Perl Module in a non-standard path
  • Download Code

Replies are listed 'Best First'.
Re^3: Executing a program from within a Perl Module in a non-standard path
by tobyink (Abbot) on Mar 20, 2013 at 15:30 UTC

    "As an aside, I can't understand how import doesn't get itself in an infinite loop!"

    System::Sub::Env::import is going to System::Sub::import. Different package; different sub.

    The reason for the goto is to hide System::Sub::Env::import from the call stack - System::Sub's import method looks at caller.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024502]
help
Chatterbox?
[Lady_Aleena]: I remember being pretty proud of that little sub when I wrote it.
[james28909]: oh xD
[james28909]: i see the predicament here.
[james28909]: maybe rename it to 'query'
[james28909]: but then you have the others as well

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-05-24 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?