[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Bug?



Hi!

Just noticed some strange behaviour, and wonder if it's a bug in MacPerl,
or in my program.

#! perl -w

use strict;

package Bug;

sub new {
	my $class = ref $_[0] || $_[0];
	print $class . " is born ...\n";
	bless {}, $class;
}

sub DESTROY {
	print "Arggh! " . ref shift() . " is killed!\n";
}

package main;

my $a = Bug->new();

__END__

prints:

Bug is born ...
Arggh!

and not the rest of the sentence. Changing the DESTROY sub to

sub DESTROY {
	print "Arggh! " . ref shift();
	print " is killed!\n";
}

gives the expected result.

Any ideas?

Thanks.



Cheers,
Ramesh



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org