in reply to Re^2: Grave accent caveats
in thread Grave accent/Backtick/`` caveats
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Grave accent caveats
by deepakg (Novice) on Jan 19, 2009 at 17:45 UTC | |
by derby (Abbot) on Jan 19, 2009 at 18:06 UTC | |
by deepakg (Novice) on Jan 19, 2009 at 18:13 UTC | |
by almut (Canon) on Jan 19, 2009 at 18:44 UTC | |
by jwkrahn (Abbot) on Jan 19, 2009 at 19:11 UTC | |
by deepakg (Novice) on Jan 20, 2009 at 05:46 UTC |