package Foo::Bar; our $error = ""; sub new { my( $class, @args ) = @_; my $self = bless( \@args, $class ); unless( $self->method_that_might_fail() ) { $Foo::Bar::error = "O noes"; return undef; } return $self; }