[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [ID 19991231.001] interpolation of $_ is busted
Larry Wall <larry@wall.org> wrote
> This appears to be because you've got USE_THREADS defined. That tends
> to lexicalize certain variables, which would tend to rule out lookup
> via the symbol name. Except that ${_} should not be looked up at
> runtime in any event. It has probably confused one or another of
> the #ifdef USE_THREADS kludges, is my guess. I don't have a USE_THREADS
> version compiled up here, so someone else will need to chase this down,
> unless I get around to it first.
I can confirm that it doesn't fail on 5.005_62 without threads.
It seems like this is all pointing to a very long standing bug (or is it
a misfeature?) - the [] causes ${a} to be taken as global, not lexical:
% perl5.002 -we '$a="b"; my $a="a"; print "${a}[]\n"'
b[]
%perl5.002 -we '$a="b"; my $a="a"; print "${a}\[]\n"'
a[]
Mike Guy
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]