Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Howdy!
Interesting... Using perl 5.6.1 on solaris: yields: $VAR1 = { 'abc' => 1, 'def' => undef }; $VAR2 = { 'abc' => 1, 'def' => undef }; $VAR1 = { 'abc' => 2, 'def' => 1, 'ghi' => 1 }; $VAR2 = { 'abc' => 2, 'def' => '1', 'ghi' => '1' }; Note the subtle difference between key 'def' in the two cases. It would appear that autoincrement on an undef does the magical string autoincrement, leading to a string value of '1', while the code FatVamp offers sets a numeric value of 1. What does it mean? I don't know, but the two forms do have ever so slightly different results whose difference probably doesn't matter.
yours, Michael In reply to Re: Refactoring: dumb or witty use of ternary operator?
by herveus
|
|