in reply to Convert shell to perl

If you really need to, then -
`sudo pgp -e test_san.dat 0x57A59396`; `sudo chown sann test_san.dat.pgp`; `sudo chgrp sanu test_san.dat.pgp`;
OR
system("sudo pgp -e test_san.dat 0x57A59396 >/dev/null"); system("sudo chown sann test_san.dat.pgp"); system("sudo chgrp sanu test_san.dat.pgp");
It should be obvious now why others have been quick to question the need to move from the shell script.

The back ticks in the first suggestion could be replaced with qx operator.

Replies are listed 'Best First'.
Re^2: Convert shell to perl
by halley (Prior) on Sep 20, 2007 at 16:24 UTC
    Backticks in void context is useless. Use system() if you don't need to create the overhead of capturing all stdout (which should be obvious from the commands here).

    --
    [ e d @ h a l l e y . c c ]