Skip to content

Instantly share code, notes, and snippets.

@nikolasco
Created March 23, 2009 20:37
Show Gist options
  • Save nikolasco/83759 to your computer and use it in GitHub Desktop.
Save nikolasco/83759 to your computer and use it in GitHub Desktop.
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