jls has asked for the wisdom of the Perl Monks concerning the following question:

BrowserUK -- Thank you for your last very helpful reply. I now have successfully installed Win32::API and NetName. However, when I use Win32::NetName; I am getting an error that reads: "Deep recursion on subroutine "Win32::API::AUTOLOAD" at D:/Perl/site/lib/Win32/API.pm line 30" The use Win32::NetName; is the only use statement I have in my program. Can anyone shed light on what would cause this error? Thanks for your assistance, jls

Replies are listed 'Best First'.
Re: Deep recursion on subroutine...
by BrowserUk (Patriarch) on Jul 01, 2003 at 18:48 UTC

    I can't reproduce your "Deep recursion" error, but I do encounter quite a few errors with the Win32::NetName package you refer to. Some of these are extremely trivial syntax errors such as:

    Parentheses missing around "my" list at d:/Perl/site/lib/Win32/VolumeI +nformation.pm line 41

    Which relates to this line of code:

    my $name,$serial,$maxlen,$flags,$fstype;

    Which is, as the error message suggests a plain and simple syntax error. To me this indicates that the module is a ways short of being ready for prime time, and your best hope of getting some assistance with the problem would be to contact the author directly via his CPAN id.

    Were this the only error, I would try taking the obvious remedial action, but I encountered various other anomolies with the module, some of which aren't consistantly reproducible, so I think that correction is best left to the author.


    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


      Except that it's not a syntaxt error, but a warnings error ;)
      Dominus says "The bug is in Perl, which is issuing a spurious warning in this case. Rafael Garcia-Suarez has fixed the bug in Perl."

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        Your probably right podMaster, but the link you gave refers to the warning being issued when a single my variable is being declared without parens, which has always been legal, so the message in that case is spurious. Whereas in the case I described, there are 5 vars being declared in the same statement, which as far as I know does require the parens.

        Ie.

        P:\>perl58 -we"my $x,$y, $z;" Parentheses missing around "my" list at -e line 1. Useless use of a variable in void context at -e line 1. Useless use of a variable in void context at -e line 1. Name "main::y" used only once: possible typo at -e line 1. Name "main::z" used only once: possible typo at -e line 1.

        Admittedly, without the -w, this examples compiles and would run were it had anything to do, but I beleive that the string of warnings issued indicate that this code is equivalent to

        my($x); $y; $z;

        Or in the case that I cited, it may well be that the author intended this line

         my $name,$serial,$maxlen,$flags,$fstype; to be equivalent to

        P:\>perl58 -mO=Deparse,-p -we" my $name,$serial,$maxlen,$flags,$fstype +;" Parentheses missing around "my" list at -e line 1. Useless use of a variable in void context at -e line 1. Useless use of a variable in void context at -e line 1. Useless use of a variable in void context at -e line 1. Useless use of a variable in void context at -e line 1. Name "main::serial" used only once: possible typo at -e line 1. Name "main::maxlen" used only once: possible typo at -e line 1. Name "main::flags" used only once: possible typo at -e line 1. Name "main::fstype" used only once: possible typo at -e line 1. BEGIN { $^W = 1; } (my($name), $serial, $maxlen, $flags, $fstype); -e syntax OK

        in which case I apologise to him unreservedly :)


        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