in reply to No <STDIN> yeilds username and password

Not that there's anything wrong with the above answers, but surely the reason for the specific problem:
if you enter nothing and hit enter it yields the username and password you have entered previously
Is that if you do that, you're doing the regex with an empty string. Which matches.

You're essentially doing if ($key =~ m//i) if they just hit return.

So you need another if clause as well as the one for "if it's 'exit'" which says what to do if it's empty.



Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...

Replies are listed 'Best First'.
Re^2: No <STDIN> yeilds username and password
by trenchwar (Beadle) on Feb 09, 2008 at 05:37 UTC
    Hey Cody....your exactly right.... I am trying to figure out the clause that will loops it back to the beginning of the while statement if it is empty.