Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

If you are really going to 'globally expose'(1) utility functions this way, then you should at least give some thought to the names, and get_id() is just about as bad as it gets.

(1) Which seems to be your intention, though as halley pointed out the definition of global is somewhat limited.

What id is that? A file identifer? A personnel identifier? A user identifier? A group identifier? A rabbit identifier? Is Idaho up for sale? Your program is a step in your quest for world-domination and your starting with Indonesia?

Or maybe the problem you are solving needs a little Freudian help, and some impulsive behaviour?

And is that get a new one? The old one? The only one? The current one? The next one?

Once you have addressed those questions, your likely to end up with a sub called retreive_current_effective_user_id_for_this_process();, but then that would probably be more easlily written as Process::Current::user_id(); (season with get/put, or get/set to taste).


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller



In reply to Re: Exporting functions into main namespace for the benefit of other use'd modules by BrowserUk
in thread Exporting functions into main namespace for the benefit of other use'd modules by tunaboy

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 contemplating the Monastery: (2)
As of 2024-04-19 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found