Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think part of the problem in this thread (and its one that ambrus has tried to touch on) is that there are important distinctions between "SV", and the collequial term "scalar" in Perl, compunded by the fact that somehow Larry let ref() get used for things that it probably shouldn't have and over time p5p have let it get quite confusing. Now to one aspect of the direct question, which is essentially is it useful to know that a given ref once dereffed needs not be further dereffed to use? IMO the answer is yes, and that SCALAR overall is useful as well. (When writing a data serialization module I found knowing it was a SCALAR versus a REF was useful. But this is a special case.) But there is the other aspect, which is essentially does the behaviour of ref make sense when applied to refs to things normally considered to be scalar values? IMO the answer is no. But not because of SCALAR or REF. But more because of GLOB, LVALUE, and "Regexp". The fact that the objects blessedness gets thrown in there makes ref even less useful. Overall ref() is a broken metaphor sitting on top of mechanism that have been stretched so far past their original design intentions that expecting it to be completely consistent doesn't make a lot of sense. I have every hope and expectation that Perl6 clears these matters up.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
• Update: In reply to Re: ref == "REF"
by demerphq
|
|