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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.