package Error::Database; ################################################################################ use 5.6.0; use strict; use warnings; ################################################################################ # This is a baseclass I use for extending the standard Error class in ways that don't matter here. use Error::Base; our @ISA = qw(Error::Base); ################################################################################ sub new { my $class = shift; my $self = $class->SUPER::new(@_) || return undef; my $txt = $self->text; if ($txt =~ /text=([^=]+)./) { $self->{-text} = $1; } elsif ($txt =~ /Message String: (.*?)$/) { $self->{-text} = $1; } return $self; } 1;