in reply to eq is being stubborn

Also, as a debugging tip, it's usually helpful to print out the values of things like this in some sort of delimiters:

warn " Compare <<$usrfile{password}>> to <<$password>>"; if ( $usrfile{password} eq $password ) { ... blah blah blah... }

I'm ashamed to admit that this has saved more time than I can shake a stick at.

Replies are listed 'Best First'.
RE: RE: eq is being stubborn
by extremely (Priest) on Oct 30, 2000 at 14:40 UTC
    No shame, no shame, print is the poor man's debugger. =)

    --
    $you = new YOU;
    honk() if $you->love(perl)

RE: RE: eq is being stubborn
by Albannach (Monsignor) on Oct 30, 2000 at 20:16 UTC
    I use that delimiter trick often, and when I'm really paranoid (or I know my strings have unpleasant characters in them) I do something like:
    print unpack('H*',$usrfile{$password}) ."\n". unpack('H*',$password);
    And I can usually see the difference then. I hope!