use Digest::SHA1; $text = "deepak.gulati"; $hash1 = `echo -n $text | openssl dgst -sha1`; chomp ($hash1); print "$hash1\n"; $hash2 = Digest::SHA1::sha1_hex($text); print "$hash2\n";I expected $hash1 and $hash2 to be equal, but that is not the case. I suspect using grave accent has some caveats. What am I missing here? Incidentally running echo -n "deepak.gulati" | openssl dgst -sha1 from shell gives the same value as $hash2. Is `echo -n $text | openssl dgst -sha1` different from issuing the same command on shell?
In reply to Grave accent/Backtick/`` caveats by deepakg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |