develooper Front page | perl.perl5.porters | Postings from November 2003

Re: Guess what this does...

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
November 8, 2003 15:02
Subject:
Re: Guess what this does...
Message ID:
20031108230206.GE24565@localhost.comcast.net
On Fri, Nov 07, 2003 at 09:18:47PM -0800, Brian Ingerson wrote:
>     'segfault' . Segfault->new('segfault');
>     package Segfault;
>     use overload '""' => sub { 'segfault' . shift };
>     sub new { bless {segmentation => 'fault'}, $_[0] }

Goes into infinite recursion and runs out of memory?

[~] perl5.8.1 -w
    'segfault' . Segfault->new('segfault');
    package Segfault;
    use overload '""' => sub { 'segfault' . shift };
    sub new { bless {segmentation => 'fault'}, $_[0] }
Useless use of concatenation (.) or string in void context at - line 1.
Deep recursion on anonymous subroutine at - line 3.
Segmentation fault


-- 
Michael G Schwern        schwern@pobox.com  http://www.pobox.com/~schwern/
"I might even owe you an apology."
"That would be nice."
"On the other hand, I thought that I was right."
        -- "The Courts Of Chaos", Roger Zelazny

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About