in reply to Strange problem with Win32::Perms

Win32::Perms autoexports various constants for use in conjunction with its methods. The problem is that one of those constants is (unhelpfully) named DIR -- which apparantly has the value 2.

The simplest work-around is to use a different name than DIR for your directory handle.

Alternatively, you could use a lexical filehandle my $DIR on the opendir and $DIR elsewhere.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.

Replies are listed 'Best First'.
Re: Re: Strange problem with Win32::Perms
by ChrisR (Hermit) on Oct 05, 2003 at 15:19 UTC
    Thanks, that took care of it. Unfortunately, I am having trouble finding good documentation for the module. The info I can find on roth.net is geared more towards an understanding of the win security model than the specifics of the module itself and I can't find the module on cpan.org. Perhaps I will buy the book that is the answer to "Need More Documentation?" on roth.net.

      Probably the best single piece of documentation with the module is the README file contained in the distribution. There are a few very simple examples about half way down.

      Beyond that, the key to understanding how to use the module, is to understand the Win32 Permissions model. It is a very powerful, but also very complex beast. The book would probably be a good way to getting an understanding of the module and how to use it, but don't be surprised if it has to go into quite a lot of detail of the OS security model to do it.

      Whilst you wait for the book to arrive, you could try the MS documentation....here is as good a starting point as any.

      Good luck.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
      If I understand your problem, I can solve it! Of course, the same can be said for you.

        I thought I was pretty well up to speed on Win32 Permissions, but there is a lot of information at the link you provided. I think I will have to spend some time reading up on that before I continue with my project. Thanks a lot!!
      ChrisR,
      I tried perldoc Win32::Perms and came up with nada. Then I started looking for documentation and got lucky. There is a README file installed with lot's of valuable information such as a FAQ. The list of constants and usage information about the module is all in the FAQ.

      Cheers - L~R

        Wow, I feel a little silly now. I'll take a look. Thanks!!