Try bypassing the backtick operator and use IPC::Open2
#!/usr/bin/perl use Digest::SHA1; use IPC::Open2; use strict; use warnings; my $text = "deepak.gulati"; my $hash1 = do_openssl( $text ); my $hash2 = Digest::SHA1::sha1_hex( $text ); print $hash1, "\n"; print $hash2, "\n"; sub do_openssl { my $text = shift; open2( my $rfh, my $wfh, 'openssl dgst -sha1' ) || die "cannot open: + $!\n"; print $wfh $text; close( $wfh ); my $value = <$rfh>; close( $rfh ); chomp( $value ); return $value; }
In reply to Re^3: Grave accent caveats
by derby
in thread Grave accent/Backtick/`` caveats
by deepakg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |