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).
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |