in reply to Re^7: compiling perl scripts aka why is perl not as fast as C
in thread compiling perl scripts aka why is perl not as fast as C

You seem to know that either by knowing the core

Quite the contrary. I'm viewing at a high level.

Let's look at foreach loops for a second. A foreach loop iterates over a list. It's how it's documented. It's how it works conceptually. The list can from a list literal, a range, an array, a function, etc. Internally, foreach treats ranges and arrays specially, but conceptually, it works on a list.

I don't see the list assignment any differently. As far as I'm concerned, the list assignment is an operator that takes a list and assigns it to a list or an array. That view is independent of the actual implementation. If I were to peak into the core, it wouldn't surprise me that @a=@b is optimised to avoid creating a list. But like you said, the internal specifics aren't being discussed.

That's how I see it.

Update: Added foreach example.

  • Comment on Re^8: compiling perl scripts aka why is perl not as fast as C