in reply to Anonymous scalar ref revisited

> Is there a simple/elegant way in Perl to create an anonymous scalar reference?

does elegant imply as fast as possible?

if not, why simply call a function scref() returning what you need? ¹

the thread you linked to, has already other fast options, you haven't listed yet.

Cheers Rolf

UPDATE: (¹) just spotted your NULLREF() (was it updated?) going in the same direction, just that your code is wrong, you don't return a ref!

correction:

# Solution 4 sub NULLREF { \ my $x } f(NULLREF);

Replies are listed 'Best First'.
Re^2: Anonymous scalar ref revisited
by rovf (Priest) on Apr 06, 2010 at 11:24 UTC
    just spotted your NULLREF() (was it updated?)
    No, was there from the beginning!

    just that your code is wrong, you don't return a ref!
    You're right, my mistake. I'll update it.
    -- 
    Ronald Fischer <ynnor@mm.st>