in reply to About Special Underscore Filehandle

As the inventor of the underscore handle, let me explain. It seemed silly that if you wanted to see if a file was both readable and writable, that you'd ask the operating system twice for the same exact information (the result of calling stat on the filename). So, I suggested to Larry that there be some way to "cache" the info. He created the underscore handle to represent "whatever we stat'ed last, we'll just remember".

So, what it remembers is "the most recent stat", which includes almost everything you want to know about the file: owner, permissions, size, timestamps, etc.

Does that help?

Replies are listed 'Best First'.
Re^2: About Special Underscore Filehandle
by PerlPhi (Sexton) on May 04, 2007 at 18:39 UTC

    oww! tnx...it helps a lot. but another thing that i just want to clarify. was the special underscore filehandle only used on a file test? or does it have other usage?

    From: PerlPhi