use Food::Product; my $p = new Food::Product('Tomato') or die("Could not instance Food::Product: ($Food::Product::errstr)"); $p->isle(14); $p->stock(450); $p->sell(450) or die($p->errstr); $p->sell(40) or die($p->errstr);