I think you might be able to do it using autobox and overload. Something like this I think:
You need at least perl 5.8.1 for this though. That's why I can't test the code myself. (I should update one of these days ...)package REF; use overload q("") => sub { die "Attempt to stringify reference" }; package main; use autobox 'REF' => 'REF', DEFAULT => undef; ...
Jenda
|
We'd like to help you learn to help yourself Look around you, all you see are sympathetic eyes Stroll around the grounds until you feel at home -- P. Simon in Mrs. Robinson |
In reply to Re: How to prevent references from stringifying?
by Jenda
in thread How to prevent references from stringifying?
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |