Pathologically Eclectic Rubbish Lister | |
PerlMonks |
chop and CGI.pm cookie problem?by michellem (Friar) |
on Jul 31, 2003 at 18:36 UTC ( [id://279710]=perlquestion: print w/replies, xml ) | Need Help?? |
michellem has asked for the wisdom of the Perl Monks concerning the following question: This is a really wierd one. I have come across an issue where issuing a chop command in a subrotine called before I set a cookie using CGI.pm prevents that cookie from being set. Yeah, I know. It sounds totally strange. But it's the only explanation I can find, and replacing my chop with a simple substr eliminates the problem! There are no errors with that statement in the error logs, and execution of the script continues unabated, so I know that's not the problem. Has anyone else run into this? What could this be due to? Here's a bit of code:The culprit subroutine was get_timestamp() - here it is: The culprit line is: my $time_frame = chop($meta_configs{login_cookie_expiration}); If I replace that with: my $time_frame = substr ($meta_configs{login_cookie_expiration},-1,1); Everything works fine! Thanks for any ideas. I'm not stuck, I obvioulsy solved the problem, but it seems strange, and I'd love to find out what the issue really is.
Back to
Seekers of Perl Wisdom
|
|