in reply to Stringifying undefs
I was hoping that this might be done using the "overload" module, but couldn't make it work. You can stringify a blessed reference into anything you like, but we know that "undef" is not a blessed reference so that doesn't help. Then I came up with this:
perl -e "BEGIN{use overload; overload::constant( integer => sub{ return 'forty two' }) } print 42"And that's not what you wanted, but it's pretty cool, huh? The problem is that overload::constant only works with actual constants, not undef values.
|
|---|