Perl just exits (via my_exit() in perl.c)Thanks for that. I now get the picture.
c:\test\perl-5.13.6>perl -E"$x = chr(0)x2**31"That doesn't generate the OOM for me on any of my perls (on both Linux and Windows). As best I can tell, the assignment fails, but there's no exit:
C:\>perl -E"$x = chr(0)x2**6;print length($x)"
64
C:\>perl -E"$x = chr(0)x2**31;print length($x)"
0
C:\>
Even with warnings switched on, the assignment simply fails silently.
UPDATE: BrowserUk was running an x64 build of perl. When I switch to any of my x64 builds, I then get the OOM error. In order to get that error with my x86 builds, it turns out I just need to run:
C:\_32>perl -e "$x=chr(0)x2**29;print length($x)"
Out of memory!
Incidentally, what's the siginificance of '-E' (as opposed to the more usual '-e') in the command ?
My copy of Programming Perl (3rd edition) pre-dates the arrival of '-E', and I don't know where perl itself documents its command line switches.
Update: Duh ... 2 minutes after posting, I think of trying 'perl -h' ... and there it is:
-E program like -e, but enables all optional features
Cheers,
Rob