Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Application using the class

  • This is the application that uses the class
package MySalary;
use strict;
use warnings;

use BaseSalary;

sub get_salary {
    my ($name) = @_;

    my $bonus = 100;

    my $obj = BaseSalary->new;
    $obj->name($name);
    my $base_salary = $obj->get_base_salary();

    return $base_salary + $bonus;
}

1;


  • How can we test that our application will report a correct error message if the 3rd party application breaks (instead of rasing an exception)?