Created
March 23, 2009 20:37
-
-
Save nikolasco/83759 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
package Amanda::Changer::Error; | |
sub new { | |
my($class) = @_; | |
my $self = {}; | |
bless($self, $class); | |
$self; | |
} | |
sub is_fatal { | |
0; | |
} | |
package Amanda::Changer::Error::Fatal; | |
use base 'Amanda::Changer::Error'; | |
sub is_fatal { | |
1; | |
} | |
package main; | |
my $err = new Amanda::Changer::Error; | |
print($err->is_fatal? "oh no!\n" : "okay\n"); | |
$err = new Amanda::Changer::Error::Fatal; | |
print($err->is_fatal? "oh no!\n" : "okay\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment