(This question is composed of sub-questions)
I've noticed that there are some functions that don't require use-ing or require-ing to use: for instance, the Time::HiRes:: functions, the utf8:: utility functions, Cwd::getcwd(), etc.
1st question (sort of offtopic): where do I find a reference/list of these functions which require no require or use to use?
I had thought at first that maybe all core modules could be called via long name without require, but then I realized that that's not the case (e.g. Data::Dumper::Dumper(), File::Copy::, etc.)...so that's one of the reasons why I'm curious about which (module) functions can be called with require or use.
But that got me thinking also about (2nd question) whether or not it makes a performance difference when using "long" package names (regardless of whether require is required) vs. use-ing (require-ing and importing) and calling the subroutine from my namespace directly. I mean does perl have to convert long names into paths or something to locate the function everytime (just a wild guess, because it might make a difference in that case)? In some of my perl scripts I actually load modules that use XS via XSLoader::load() directly (and XSLoader doesn't require a require, a surprise to me) directly, and then I have to call the functions I want to use via long names each time.
These things might seem trivial to most, but I'm just really curious and would probably do things a little differently if I knew what was going on. Sometimes I try to avoid conveniences if it leads to benefits in other areas.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |