Help for this page

Select Code to Download


  1. or download this
    sub get_price{
        my $self = shift;
    ...
            : ( $self->{_quantity} * $self->{_item_price} ) * 0.98
        );
    }
    
  2. or download this
    sub get_price{
        my $self = shift;
    ...
        my $base_price = $self->{_quantity} * $self->{_item_price};
        return $base_price *= $self->{_quantity} > 1000  ? 0.95 : 0.98;
    }