develooper Front page | perl.perl5.porters | Postings from June 2008

Overload Segfaulting

Thread Next
From:
Ovid
Date:
June 12, 2008 08:13
Subject:
Overload Segfaulting
Message ID:
621611.94913.qm@web65714.mail.ac4.yahoo.com
I sent this via perlbug, but our Solaris box can be flaky, so I'm
resending manually.  Apologies if this is sent more than once.

The following segfaults on Solaris, Ubuntu 7.10 and Windows (all of
whom are running 5.8.8).  Seems like a fairly universal failure.

  use strict;
  use warnings;

  {
      package Some::Package;
 
      use overload
          '++'     => sub { print "object is $_[0]\n" },
          fallback => 1;

      sub new { bless {} => shift }
  }

  my $object = Some::Package->new;
  print $object++;

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog     - http://use.perl.org/~Ovid/journal/

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