Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Call perl script from within another perl script

by pjf (Curate)
on Sep 12, 2008 at 04:14 UTC ( #710795=note: print w/replies, xml ) Need Help??

in reply to Call perl script from within another perl script

I'd try using the FindBin module. This means that even if there's weird things going on with chroot and paths being rewritten, you should hopefully get the other script invoked:

use FindBin qw($Bin); system($^X, "$Bin/");

This is assuming that your is in the same directory as your calling script. If you're wondering what $^X is, it's the full path to your perl interpreter, which means the above line should work, even if Perl is not in your path.

I'm using the two-argument version of system, which means that if your host is a Unix-flavoured system, it should avoid the shell (and hence any problems where your script may not have a shell to run).

It's also recommended that you check the return value from system(), so if something does go wrong, you know about it. I personally use IPC::System::Simple for this task, which automates most of the checking and diagnostics, but being Perl there's more than one way to do it.

All the best,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://710795]
[Corion]: Discipulus: If you want to rewrite the SVG, then yes, something like XML::Twig should be enough. I would try to not modify the SVG but only modify the display, but so far I haven't convinced IE to change the style...
Corion gives up
[Discipulus]: ah! so you mean if i need a static image i can use Twig, if on the fly better css selector and mody attrs (jquery?), rigth?
[LanX]: not sure what you guys are taking about, but a DOM manipulation in JS shouldn't be difficult
[Corion]: Discipulus: Yeah, that's what I would try (but so far, I can't even change the colors manually in the SVG, which is why I gave up ;) )
Discipulus bad sign..
[Discipulus]: italian doc says to modify somehow the initial SVG before using it with D3.js

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2017-03-23 09:42 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (285 votes). Check out past polls.