Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Oh I agree about strict and warnings - but, frankly, I'm not sure that warning would have helped alot. 'Cause if the problem is that the " = 1" in
creates a reference to %1, then why doesn't using something other than "1" correct the problem? I mean, I just want to set the value of a hash element to one. I love Perl - it's responsible for most of my personal income and written into most of my work by choice - so don't get me wrong on this next statement - but on a rare occasion Perl does really make me shake my head. It's not like I'm trying to invent calculus here. I just want to set the value of a hash element to 1 then recall the key. It shouldn't take strict and warnings and an in-depth discussion of special variables and references and most of the afternoon...this sort of thing is just ammunition for the anti-Perl crowd...ok, venting off... By the way, using {} did make the script work correctly, with the sole exception that now $booklist_1{$book_id} equals 'HASH(0x8529f88)' - which is not a problem, per se, since I don't use it, but it seems a very messy result. Time flies like an arrow. Fruit flies like a banana. In reply to Re^6: Why is my code assigning the last-retrieved value to all elements in my hash?
by punch_card_don
|
|