Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: eval and chroot strange behavior

by pc88mxer (Vicar)
on Apr 02, 2008 at 06:13 UTC ( [id://677899]=note: print w/replies, xml ) Need Help??


in reply to eval and chroot strange behavior

In true the problem is the chroot, but I suppose that inside eval it not propagate in the rest program.
This is not the case. eval doesn't preserve your process's root directory. So if you change it with chroot, it remains changed until you change it again.

One way you might be able to accomplish what you want to do is to execute your code in a child process and communicate the result back to the parent.

Replies are listed 'Best First'.
Re^2: eval and chroot strange behavior
by mattk (Pilgrim) on Apr 02, 2008 at 11:41 UTC

    As above, and this is how you fix it:

    my @list = qx{chroot $config{root} ldd $my_bin/};

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found