At 5:27 PM +1100 11/20/02, Ken Williams wrote:
>On Wednesday, November 20, 2002, at 04:06 PM, Michael G Schwern wrote:
>>2.) my($key) forces list context but the result of a match can only be
>>stored in a scalar lvalue
>>3.) The result of a match is just a boolean, not the thing matched, so
>>$key would never have the unadorned macro name but that should be in $1.
>
>Nope, the original code would work.
You are of course correct that list context should capture matched
values (Camel 3, p. 150).
However, I think code has to compile before it will work :-)
$ perl -c "lib/ExtUtils/MM_VMS.pm;-0"
Global symbol "@fileist" requires explicit package name at lib/ExtUtils/MM_VMS.pm;-0
line 1413.
Global symbol "$key" requires explicit package name at lib/ExtUtils/MM_VMS.pm;-0 line
1415.
BEGIN not safe after errors--compilation aborted at lib/ExtUtils/MM_VMS.pm;-0 line
1931.
The complaint about $key was at the 2nd line here, not the 1st as I
originally thought:
if (my($key) = $word =~ m#^\$\((.*)\)$# and
ref $self->{$key} eq 'ARRAY')
I think the issue is that you can't use a variable in the same
statement in which you declare it. This works:
$ perl -e "use strict; my $foo='bar'; print $foo;"
bar
but this doesn't:
$ perl -e "use strict; my $foo='bar' and print $foo;"
Global symbol "$foo" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.
--
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser