in reply to Re: Re: Sometimes it's in Void Context
in thread Sometimes it's in Void Context
The brackets are forming an array context. You're assigning an array to the array member$lines[0] = [ 3,2,1 ];
I am assuming what is going here is that the array dereference is looking for a numerical value to figure out where to look in the array. You get the same error here:print $lines[0][ 3,2,1 ];
Looking at the comma operator in the perlop page, this makes sense. The values are evaluated one by one.print scalar(4,5); jaybonci@starlite:~/perl/pm$ ./array.pl Useless use of a constant in void context at ./array.pl line 6. 5jaybonci@starlite:~/perl/pm$
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Sometimes it's in Void Context
by Aristotle (Chancellor) on Jun 01, 2002 at 18:29 UTC | |
by JayBonci (Curate) on Jun 01, 2002 at 19:03 UTC |