update: I guess I should've read the entire thing first ;) but not to fear, read on ...sub foy { my $ref = shift; canonicalize($ref) unless $ref->isa('_Canonical'); }
If I store a flag in a hash indexed by the ref's string, is that string always the same?
Yes. A reference to the same structure will always stringify the same (in the same instance of the program of course), otherwise, the perl garbage collector couldn't work (reference counting is, well, reference counting, so it has to stringify the same).
Also, to learn about attributes, check out the pragma.
|
MJD says you can't just make shit up and expect the computer to know what you mean, retardo! ** The Third rule of perl club is a statement of fact: pod is sexy. |
In reply to Re: Marking an array as already seen
by PodMaster
in thread Marking an array as already seen
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |