On Fri, Aug 29, 2003 at 08:40:49AM +0200 Rafael Garcia-Suarez wrote: > tassilo.parseval@post.rwth-aachen.de (via RT) wrote: > > According to my knowledge, @- and @+ should be dynamically scoped so it's > > obvious that they still have their values in Tie::Prematch::FETCH() when doing > > > > $foo =~ s/.ob/tied(%pre)->FETCH($foo)/e; > > > > But they somehow loose them when doing > > > > $foo =~ s/.ob/$pre{ $foo }/; > > > > even though it should be functionally identical. > > No, the /e creates a scope. Add a /e to your 2nd example and it becomes > equivalent to the 1st one (apparently). I don't understand this. Why do I need this additional scope in the second case? In which scope is FETCH() called without the /e? Since the values of these dynamically scoped variables aren't accessible in it, it must be a scope above the one from the whole substitution (or rather: above the scope where @- and @+ are set). Or am I wrong here? And secondly, why don't I need the /e when I use %- (for instance) as the tied hash? Adding an /e, if I may say that, is also highly strange. The right-hand side of a substition is in double-quotish context. But: $a{a} = "foo"; $s = "foo"; # these two will give the same results $s =~ s/./$a{a}/e $s =~ s/./$a{a}/; print $s; This is not something that would become obvious when reading about /e in perlop.pod. Tassilo -- $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({ pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#; $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval