There are no more warnings. The only problem I have now is adding users, and it will only log in for one of the default users(aharris). What program should I use to debug it?
When I run it, I get:
1. Log in
2. Log out
3. Administration
Enter selection: 1
Enter your user name to log in: aharris
Odd number of elements in hash assignment at ./maybe.pl line 23, <STDIN> line 2.
Odd number of elements in hash assignment at ./maybe.pl line 33, <STDIN> line 2.
Enter your password: 1234
Use of uninitialized value $logins{"aharris"} in numeric comparison (<=>) at ./maybe.pl line 37, <STDIN> line 3.
Welcome aharris.
Current time is Mon May 5 11:44:51 2008
? | [reply] |
| [reply] |
Starting your script like: perl -d scriptname.pl will bring it up in the perl debugger. Read perldebug. You may also want to dump your data structures at opportune moments with Data::Dumper.
Your code is well formatted and except for the while() loop surrounding a bunch of subroutine definitions ( the subroutine definitions should be outside the execution path ) otherwise the code is very readable. The parameter passing is incorrect however. Subroutine calls like some_sub( %hash ) are usually not correct as perl passes your hash structure as a flat list which then becomes a local copy in the subroutine. What you probably should be doing is passing a reference to the hash. See: perlreftut. This is why your data structure is not getting updated as your routines only modify their local copy of the structure.
s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s
|-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,,
$|=1,select$,,$,,$,,1e-1;print;redo}
| [reply] [d/l] |