|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: Bitwise & not working correctly in CGI scriptby kennethk (Monsignor) |
| on Jun 13, 2012 at 15:30 UTC ( #975996=note: print w/ replies, xml ) | Need Help?? |
|
I cannot not recover your issue. If I run the code provided (after adding use Carp 'cluck';, my $job_type = 65;, and a closing quote on your line 4, I get the output on STDERR: I suspect your issue is that what you actually mean to have is something like
The difference here is that I am now only outputting when the if condition is true; your if applied only to the assignment, not the cluck. Update: Jenda also has a plausible explanation, if Re: Bitwise & not working correctly in CGI script is correct. This makes sense if you are pulling the string out of $cgi->param, which contains only strings. You can numify the result using my $job_type = 0+ $cgi->param('job');, for whatever those variables are called locally. #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||