in reply to Re^3: Why it takes so much time here?
in thread Why it takes so much time here?

I printed the time before and after the iteration, the result is both 1325041218:

print time . "\n"; my @a = any {$_== 92} 1..100000000; print "\n"; print time;

So the time is not taken by the iteration..

Replies are listed 'Best First'.
Re^5: Why it takes so much time here?
by ikegami (Patriarch) on Dec 28, 2011 at 04:27 UTC
    oh, yes it is. 1..100000000 is executed a compile-time (constant folding).

      The same number of int takes less than 1 second to initialize

      Isn't 15 secs too much time even though a scalar requires more storage(16 bytes after test) than int?

        The same number of int takes less than 1 second to initialize

        What does that mean?