in reply to Re^2: md5_hex gives different values for same string
in thread md5_hex gives different values for same string

It would be logical that chomp isn't behaving the way you'd expect. Perhaps use regular expressions that explicitly state what you're trying to do until you're comfortable with how chomp functions. Or even write a function of your own.. e.g.
sub remove_trailing_newlines( $ ) { my ( $stringref ) = @_; ${$stringref} =~ s/[\r\n]+\z//gs; }
. Then call it instead of chomp. E.g.
remove_trailing_newlines( \$cmd ); remove_trailing_newlines( \$check );

Replies are listed 'Best First'.
Re^4: md5_hex gives different values for same string
by jonsmith1982 (Beadle) on Oct 10, 2006 at 13:55 UTC
    sorted...
    $check =~ s/[\r\n]+\z//gs;
    thanks again.