Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^5: ref == "REF"

by Anonymous Monk
on Oct 18, 2004 at 21:00 UTC ( [id://400319]=note: print w/replies, xml ) Need Help??


in reply to Re^4: ref == "REF"
in thread ref == "REF"

Yes it would.

But then you are doing two calls to ref instead of one...

But then another question would be, which one would be the most efficient? (assuming the perl-interpreter does not return REF (and doesn't do any check on it))

Replies are listed 'Best First'.
Re^6: ref == "REF"
by gaal (Parson) on Oct 18, 2004 at 21:13 UTC
    The current behavior would be the more efficient one. But it is also less clean, conceptually, so (I'm come to conclude) it shouldn't belong in the ref builtin.

    This doesn't matter, though. It is a *very simple extension* to add this feature outside core perl. Something along the lines of:

    use Inline C => << "EO_REFREF"; int refref(SV* thing) { return SvROK(SvRV(thing)); } EO_REFREF
    (This is not anywhere near tested, though :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://400319]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-03-19 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found