Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: standard perl routine

by BrowserUk (Pope)
on Apr 30, 2006 at 08:01 UTC ( #546564=note: print w/ replies, xml ) Need Help??


in reply to Re^2: standard perl routine
in thread standard perl routine

Specifying an import list explicitly prevents POSIX from importing anything other than the functions you specify:

c:\test\546536>p1 print scalar keys %main::;; ## Before use POSIX main has how many glob +als? 67 use POSIX qw[ pow ];; print scalar keys %main::;; ## and after is has 72 Terminating on signal SIGINT(2) c:\test\546536>p1 $h{ $_ }++ for keys %main::;; ## Record what we have before use POSIX qw[ pow ];; $h{ $_ }++ for keys %main::;; ## Again after print for grep{ $h{ $_ } == 1 } keys %h;; ## Display the differences _<c:/Perl/lib/auto/POSIX/POSIX.dll XSLoader:: POSIX:: pow _<POSIX.c

Two 'private' paths, two new namespaces and one new function (pow) in main.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^3: standard perl routine
Download Code
Re^4: standard perl routine
by davido (Archbishop) on Apr 30, 2006 at 08:03 UTC

    Ah, so it does. Good call. The same mechanism that makes use POSIX (); (ie, import an empty list) exclude all, also makes use POSIX qw/pow/; exclude all others.


    Dave

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2015-07-07 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls