in reply to Resource allocation question

Im not sure, and have not tested this, but my guess would that Case 3 would be the most effecient. According to perlop qw() "generates a real list at compile time". It seems to me that would be the most efficient way of doing things. Of course at this point in the docs they are comparing qw() to split(' ', $STRING) but it does lead me to believe the list is created once, and simply sticks arround somewhere. But I could be wrong, and often am. Just my two cents.

May the Force be with you

Replies are listed 'Best First'.
Re^2: Resource allocation question
by shemp (Deacon) on Oct 20, 2004 at 17:58 UTC
    I am more interested in whether the list sticks around, as opposed to the time to create with qw() or whatever. blah() would be a function that is called many, many times during execution, and i only want @list to be initialized once.