On Thursday, June 27, 2002, at 12:07 , Felix Geerinckx wrote:

> on Wed, 26 Jun 2002 22:56:23 GMT, [EMAIL PROTECTED] (Drieux) wrote:
>
>> We keep tossing around these 'map' tricks -
>> and I was wondering why we do not put them up in
>> the
>>
>>      BEGIN {
>>           %in = map { $_ => 1} qw(h eh hd p c);
>>           ....
>>      }
>>
>> So that we compile them once?
>
> Just curious, what makes you think that code is compiled more than
> once, unless you put it in a BEGIN block (or did you mean 'compile' in
> the classical sense instead of the CS sense?)


Good Point... we visit the 'BEGIN block' each time the code
is executed - but I was thinking in terms of stuff like the
fastcgi - and daemons - were we visit the 'BEGIN block' once
on invokation - and will not come that way again....

The 'fear' I was imagining was

        sub doFoo {
                my ($arg) = @_;
                my %in = map { $_ => 1} qw(h eh hd p c);
                return($in{$arg});
        }

and the potential of going through the 'map' sequence
each time that the function was called... but that
shouldn't happen??? since the 'mapping' is 'static'
in nature.... hence would be 'distilled to a Data Structure'
once at 'compile time' and not need to be 'distilled to opCode' and 
executed to
generate the static data structure on each invokation...

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to