Can someone explain to me the difference between
my $nulls = $_;
$nulls =~ /\0/g;
$nulls = length($nulls);
my $nulls = () = $_ =~ /\0/g;
I get an "Out of memory!" exception with the 2nd example (once $_ length is long enough, it works fine most of the time).
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,