in reply to Re^2: Escape variables
in thread Escape variables

I have some quibbles about how you accept input. In a standard command line I/F leading or trailing spaces should not matter. But this looks to me like it should "work". How are you printing $password?