Perl references not returning correct values
this is my first time asking a question here so apologies if I am not following any conventions correctly.
I encountered a bug in some Perl code that basically lost any parameters in the URL after the first name-value pair and the solution was to use the URI::Escape
function on the URL.
After this change I decided to move code that does this to a Perl module (Utils.pm) so that any future changes only need to be made once in this file, rather than have to update every file that uses it.
The problem I seem to have is that the user, passwd and priv variables don't seem to return the correct values - the system still allows you to sign in but it can't identify your name or the privileges that you have.
Below is a link to a pastebin of the code I believe to be relevant to the p开发者_如何转开发roblem.
I believe it is to do with the references but any changes I make just break the page!
If anyone has any ideas I would greatly appreciate the help.
http://pastebin.com/tqGfGutW
I managed to sort this out by trying a couple of things.
In Utils.pm I simply took out the backslashes so that it reads:
$res = CGI_ats::GetUserandPasswd($user, $passwd, $privs);
since these are already referenced a couple of lines prior to this, I suppose it makes sense to not have to reference them again.
精彩评论