> if ( $viewtag = "1" ) {
> print "The value of \$view was $view\n<p>";
> }
There are a few problems with that. First, you generally want a double equals '=='
with a numeric
comparison. You are assigning the value of "1" to $viewtag with returns "1" as the
result which
automatically evaluates to true. Try this one-liner:
perl -e 'print $x = 7'
That should print '7', which is the return value. However, when you change that to
the following:
perl -e 'print $x == 7'
It will print nothing (actually, the empty string), because it's returning a false
value.
However, you have "1" in quotes, which treats it as a string instead of a number. If
you're
trying to do a string comparison, you want 'eq' instead of '=='.
Cheers,
Curtis Poe
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/