I was writing a fairly long perl script, when I encountered a problem I never expected. I am somewhat new to perl, so this may seem pretty obvious to you guys, but here's my problem.
If you have:
Code:
$a=<>;
if ($a==1)
{
print "hi\n";
}
and you enter '1' at the prompt, it prints out 'hi'.
But if you have:
Code:
$a=<>;
if ($a eq 1)
{
print "hi\n";
}
It doesn't do anything. So what exactly am I missing?