Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How to declare globally visible subroutine like built-in ones ? Is it possible?

by shmem (Chancellor)
on Nov 06, 2007 at 12:44 UTC ( #649200=note: print w/replies, xml ) Need Help??


in reply to How to declare globally visible subroutine like built-in ones ? Is it possible?

You could
*::global_sub = \&global_sub;

and qualify your global subs with the empty package, on invocation:

$result = ::global_sub($args);

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: How to declare globally visible subroutine like built-in ones ? Is it possible?
by bdimych (Monk) on Nov 06, 2007 at 13:22 UTC
    Thanks, Anonymous Monk, shmem It works, but ugly annoying evil :: remains! :)

    Anonymous Monk No, overhead is not the problem. I have not exact instructions, what I've asked about. I may change any code of the project and even G:: is, in general, ok.
    My question is exactly subject, it is just interestingly to me.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2023-12-09 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?