in reply to Re: Deep recursion on subroutine...
in thread Deep recursion on subroutine...

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.

  • Comment on Re: Re: Deep recursion on subroutine...

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

    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