in reply to Can I ask Perl if an object will stringify?
Don't start fiddling with internals.
In any case you can only do runtime checks in Perl.
So if you get the default stringification from an object (IIRC that's what ref returns) you are free to warn, that something looks strange.
Don't try to overengineer your function!
Sometimes "it's easier to ask for forgiveness than it is to ask for permission. " (stolen from Python ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can I ask Perl if an object will stringify?
by Your Mother (Archbishop) on Mar 30, 2015 at 21:52 UTC | |
|
Re^2: Can I ask Perl if an object will stringify?
by RonW (Parson) on Mar 30, 2015 at 21:00 UTC | |
by LanX (Saint) on Mar 31, 2015 at 12:57 UTC | |
|
Re^2: Can I ask Perl if an object will stringify?
by Dumu (Monk) on Apr 01, 2015 at 09:45 UTC | |
by LanX (Saint) on Apr 01, 2015 at 10:02 UTC | |
by Dumu (Monk) on Apr 01, 2015 at 15:24 UTC | |
by LanX (Saint) on Apr 01, 2015 at 15:26 UTC | |
by Dumu (Monk) on Apr 01, 2015 at 20:26 UTC | |
|
Re^2: Can I ask Perl if an object will stringify?
by haukex (Archbishop) on May 25, 2015 at 10:17 UTC |