[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Delayed semantical interpretation



Tied variables and barewords.

A simple:  $foo{this} = bar;  can mean many, many, many things.

First off, is %foo a tied hash?  Is so then it has to be translated
into the approriate method call (in this case $tied->STORE) and then
there's all the run-time method lookup fun that goes along with it.

Then, since bar is a bareword it has to check if &bar exists (I don't
know if this happens at runtime or compile time).  If bar is a
subroutine name then bar must be called and its context determined
(that's probably compile time, come to think of it).

Either way, I doubt you can express this in a BNF.


On Wed, Sep 22, 1999 at 10:01:10AM -0700, Peter Scott wrote:
> What's the most egregious construct in Perl with respect to this 
> behavior?  Only a few tokens at most; I'm talking about language elements 
> here, not obfuscated programs.  Something which produces the widest range 
> of possible behavior that can't be narrowed until run-time.  eval doesn't 
> count :-)

-- 

Michael G Schwern                                           schwern@pobox.com
                    http://www.pobox.com/~schwern
     /(?:(?:(1)[.-]?)?\(?(\d{3})\)?[.-]?)?(\d{3})[.-]?(\d{4})(x\d+)?/i

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe