On Thu, October 18, 2007 2:47 pm, Chas. Owens wrote:
> On 10/18/07, Paul <[EMAIL PROTECTED]> wrote:
> snip
>> >>>> The output is:
>> >>>> text
>> >>>> 0
> snip
>> The function is like this:
>>
>> my$variable = (system "/usr/sfw/bin/openssl rsautl -decrypt -inkey
>> private.pem -in cryptedfile")
> snip
>
> There is no way that $variable will have the data you want.  The
> system function only returns the exit code and exec status of the
> subshell it spawns.  The reason you are seeing the data you want in
> the output is because the subshell is writing to STDOUT.  You need to
> be using the qx// (or backtick) operators to capture the subshell's
> output:
>
> my $var = qx(/usr/sfw/bin/openssl rsautl -decrypt -inkeyprivate.pem
> -in cryptedfile);
> print "I got [$var]\n";
>
Thank you, the "qx" worked.  Forgot all about that thing.


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


Reply via email to