RICHARD FERNANDEZ wrote:
[...]
It decrypts my file successfully. But if I break up the arguments
like it says in the doco, like so:

        my @gpg_command = ("/usr/bin/gpg", "--decrypt", $encrypted, ">",
$decrypted, "2> /dev/null");

AFAIK, you can't use "2> file" to do output redirection when you use the multiple-arguments form of 'system' because the shell isn't available.

Use open() to redirect STDERR to /dev/null before you call system.

Read "perldoc -f open."

        system(@gpg_command) == 0 or warn "system @gpg_command failed:
$!";

it does not work. Instead I get a "usage" error.
[...]

gpg doesn't know what to do with a parameter of "2> /dev/null."


Could someone please explain where I've gone wrong? I would like to use
Crypt::GPG instead of system, but I have to get this finished.
Thanks!

richf


You're welcome.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to