in reply to How to prevent references from stringifying?
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 |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to prevent references from stringifying?
by xmath (Hermit) on Oct 03, 2004 at 20:46 UTC |