All pastes #38048 Raw Edit

sdakota

public text v1 · immutable
#38048 ·published 2006-01-22 18:34 UTC
rendered paste body
-----------this is a piece of code from shell.pl...-----------------
                print "Please log in.\n"; # line 36
                print "Username: ";
                my $username = <STDIN>;
                print chomp($username);
                print chomp($username); # line 40
                print "Password: ";
                ReadMode 2;
                my $password = <STDIN>;
                print chomp($password);
                print chomp($password); # line 45
                ReadMode 0;
                print "\n"; # line 47
---------------------and another piece later...---------------------
                        print "Wrong username: \n'$username'\n or password: \n'$password'\n.\n";
--------------------(the $username and $password are like this just for testing purposes)
-------------------then this is the output when using it locally...------------------
server:~/403ad# perl shell.pl
Welcome to 403AD!
Please log in.
Username: hello
10Password: 10
Wrong username: 
'hello'
 or password: 
'password'
.
-------and this is a part of the output of the server when using it through telnet...----------
server:~/403ad# perl -Tw main.pl
main.pl 26472: server started on port 3000 at Sun Jan 22 18:56:31 2006
main.pl 26472: connection from localhost.localdomain [ 127.0.0.1 ]
                at port 41725 at Sun Jan 22 18:56:33 2006
main.pl 26472: begat 26474 at Sun Jan 22 18:56:33 2006
Use of uninitialized value in scalar chomp at ./shell.pl line 39, <STDIN> line 2.
Use of uninitialized value in scalar chomp at ./shell.pl line 40, <STDIN> line 2.
-------.. and the things I see at the telnet client: ----------
server:~/403ad# telnet localhost 3000
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Welcome to 403AD! Connecting to your shell....
Welcome to 403AD!
Please log in.
Username: hello
10Password: test
10
Wrong username: 
'hello
 or password: 
'test
.
Please log in.
Username: ^]
telnet> quit
Connection closed.