in reply to Re: @- Bug on the loose, lets isolate it
in thread @- Bug on the loose, lets isolate it
How serious/harmful is this bug?
Well, I actually stumbled into it in this context:
my $string = 'abc'; while( $string =~ /b/g ) { print "@-\n"; }
Which is in and of itself pretty much useless code. However, what alerted me to the bug was that all of the sudden my script appeared to hang. My first thought was that I must be stuck in a loop, but quickly realized that I was experiencing Perl trying to interpolate a 2million element array full of 'undef' elements into a double-quoted string. It was chugging away, building this space-delimited string and presumably consuming more and more memory until I finally got tired of waiting and hit CTRL-C.
The point is that this simple snippet could grind a system to a halt with all available memory consumed. Sure, it's a contrived example, but who wants Perl suddenly to create an array of millions of elements?
Dave
|
|---|