Consider:

perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}'
[no result]

perl -le '$hash{"foobar"} = 1; print $hash{foobar}'
1

I sort of understand this: in the first script, Perl treats foo-bar as
a subtraction, and sets $hash{0} to 1. In the second one it assumes
you just left off some quotes.

My question: since Perl doesn't have constants, what exactly IS
foo-bar? Why is it 0?

The behavior above seems inconsistent to me. Is it considered a bug?

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to