Help for this page

Select Code to Download


  1. 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";
    
  2. 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";
    
  3. or download this
    {
        package Tax::Zone;
    ...
    
    my $barland = Tax::Zone->new(0.15);
    print $barland->add_tax(50.00), "\n";