Hello All, I was working with hashes and came up with a queer-looking problem. This is my code. %hash = (a=>a1, b=>a2 ); print %hash . "\n";
The O/p comes as 2/8. This is as expected showing the used and allocated buckets. But the problem occurs when I change the value of b from "a2" to "2a". Perl shows me the following error  /div> C:\Documents and Settings\Owner\Desktop\ukhas\perlprgrms>perl del.pl Bareword found where operator expected at del.pl line 2, near "2a" (Missing operator before a?) syntax error at del.pl line 3, near
"2a " Execution of del.pl aborted due to compilation errors. I understand its asking me to put quotes in this case; when I did that the error vanishes and the O/p is same as before. My question  /div> Why is Perl reporting an error for the value "2a" and not for "a2"?? I am using Perl v 5.8 and WinXP Have a great day and GOD bless!!! Thanks and Regards, Ukhas Jean ;
Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.
|