eval { GD::Image->trueColor(1) }; if ($@) { # e.g. write to log that this method is not existing }