Beefy Boxes and Bandwidth Generously Provided by pair Networks
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.
    -- Gandhi

    Flux8


• Update:  
Minor edits.



In reply to Re: ref == "REF" by demerphq
in thread ref == "REF" by gaal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 19:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found