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 :)
In reply to Re: Re: Re: Deep recursion on subroutine...
by BrowserUk
in thread Deep recursion on subroutine...
by jls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |