- or download this
package PriceType;
use base qw(Class::Singleton);
...
my $id = $id;
{ no strict 'refs'; *{$method} = sub { $id } };
};
- or download this
sub get_price {
my ($self, $price_type) = @_;
...
my ($price) = $sth->fetchrow_array;
return $price;
}
- or download this
my $cost = $product->cost;
my $list = $product->list_price;
my $sale = $product->sale_price;
- or download this
my $cost = $product->price(PriceType::Cost->instance);
my $list = $product->price(PriceType::ListPrice->instance);
my $sale = $product->price(PriceType::SalePrice->instance);
- or download this
my $cost = PriceType::Cost->instance->get_price($product);
my $list = PriceType::ListPrice->instance->get_price($product);
my $sale = PriceType::SalePrice->instance->get_price($product);