Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: typeglob/symbolic reference question

by codeacrobat (Chaplain)
on Nov 04, 2010 at 07:44 UTC ( #869410=note: print w/replies, xml ) Need Help??


in reply to typeglob/symbolic reference question

Have you considered Sub::Install?
perl -MSub::Install=install_sub -e 'install_sub({code => sub{print "g +reen".$/}, into => +__PACKAGE__, as => "color"}); color()' green

print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});

Replies are listed 'Best First'.
Re^2: typeglob/symbolic reference question
by BrowserUk (Pope) on Nov 04, 2010 at 14:36 UTC

    Why? In the end, it does exactly the same thing:

    *{"$pkg\::$name"} = $code;

    but a hell of a lot more convolutely.

    And along the way, eschews using perfectly good Perl in favour of long laborious constructs because the author prefers to "whore for Devel::Cover"

    # I'd rather use ||= but I'm whoring for Devel::Cover. for (qw(into from)) { $arg->{$_} = $calling_pkg unless $arg->{$_} +}

    That's just ...


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2020-11-01 01:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (291 votes). Check out past polls.

    Notices?