Michael Kittrell has asked for the wisdom of the Perl Monks concerning the following question:
andmy $nulls = $_; $nulls =~ /\0/g; $nulls = length($nulls);
I get an "Out of memory!" exception with the 2nd example (once $_ length is long enough, it works fine most of the time).my $nulls = () = $_ =~ /\0/g;
I assume it has to do with combining the multiple commands on one line and the particulars of how that's managed in memory... I'd love to know exactly what is happening and how that affects memory consumption or some sort of stack/register space etc...
Thanks in advance,
michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Out of Memory
by davido (Cardinal) on Mar 27, 2013 at 18:12 UTC | |
by Anonymous Monk on Mar 28, 2013 at 17:25 UTC | |
by BrowserUk (Patriarch) on Mar 28, 2013 at 17:38 UTC | |
by Michael Kittrell (Novice) on Mar 28, 2013 at 19:05 UTC | |
by BrowserUk (Patriarch) on Mar 28, 2013 at 19:12 UTC | |
| |
by davido (Cardinal) on Mar 28, 2013 at 17:29 UTC | |
by BrowserUk (Patriarch) on Mar 28, 2013 at 17:40 UTC | |
by davido (Cardinal) on Mar 28, 2013 at 17:46 UTC | |
by Michael Kittrell (Novice) on Mar 28, 2013 at 19:19 UTC | |
|
Re: Out of Memory
by CountOrlok (Friar) on Mar 27, 2013 at 18:45 UTC | |
by CountOrlok (Friar) on Mar 27, 2013 at 19:28 UTC | |
by Anonymous Monk on Mar 28, 2013 at 16:04 UTC | |
by Anonymous Monk on Mar 28, 2013 at 17:27 UTC |