Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: diamond operator question

by Tomtom (Scribe)
on Jun 09, 2005 at 12:55 UTC ( [id://465102]=note: print w/replies, xml ) Need Help??


in reply to Re^3: diamond operator question
in thread diamond operator question

Excuse me for keeping asking questions about this :) but it's for my own curiosity :

What could be the different ways to detect the kind of filehandle, to know if it was opened by open or opendir ?
Apparently, the following quote :
"DIRHANDLEs have their own namespace separate from FILEHANDLEs." (source)
could help detecting whether it was opened by open or opendir.
But when I do something like the following code to see the difference between the two namespaces, I get the same result for both of them.
open(DIR, './random_file'); print 'open : ', *main::DIR{NAME}, ' - ', *main::DIR{PACKAGE}, "\n"; opendir (DIR, '.'); print 'opendir : ', *main::DIR{NAME}, ' - ', *main::DIR{PACKAGE}, "\n" +;
Am I doing something wrong, or is there another way to differentiate the namespaces of the handles ?
Or could it be the version of Perl I'm using ( 5.005 ) ?

Thanks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-26 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found