in reply to pivot_root in perl ?

Also, as you probably have to run pivot_root only very rarely, you can write only that part as a separate C program and call that from perl.

Update: I seem to have it as a pre-installed program on my debian system too.