in reply to Re: How to burn 100 megabytes in one line and still get the wrong answer
in thread How to burn 100 megabytes in one line and still get the wrong answer
I belive perl will see the 'x' operator and try to allocate the necessary memory in one block. The OS will quickly not find a memory range large enough and fail the request, prompting perl to die.
The alternative that would cause perl to die slowly would be if 'x' allocated a small string, copied it's first parameter into it until it ran out of space, then allocated a slightly larger sting, copied the old sting in, de-allocate the old sting, then continued to copy the first parameter until it ran out of room again. But that would be horribly inefficient. (even for perl =)