RE: Crypt::GPG won't decrypt file...rewrote it to use system, but only partially works



I re-wrote the decryption routine to use system instead of Crypt::GPG,
and came across another puzzle:

my @gpg_command = ("/usr/bin/gpg --decrypt $encrypted >
$decrypted 2> /dev/null");
system(@gpg_command) == 0 or warn "system @gpg_command failed:
$!";

works. 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");
system(@gpg_command) == 0 or warn "system @gpg_command failed:
$!";

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


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
.