- or download this
our $TaxRate = 0.20;
sub add_tax {
...
# Let's swap to a country with a lower tax rate
$TaxRate = 0.15;
print add_tax(50.00), "\n";
- or download this
sub add_tax {
my ($price, $TaxRate) = @_;
...
print add_tax(50.00, 0.20), "\n";
print add_tax(50.00, 0.15), "\n";
- or download this
{
package Tax::Zone;
...
my $barland = Tax::Zone->new(0.15);
print $barland->add_tax(50.00), "\n";