Help for this page

Select Code to Download


  1. or download this
    # protected add to set credit
    sub setCreditAmount {
    ...
        caller(0)->isa(__PACKAGE__) || confess "setCreditAmount is protect
    +ed";
        &{$closure}( "CREDITAMOUNT", $amount );
    }
    
  2. or download this
    # public method to add to the account
    sub addToAccount {
    ...
        my $amount    = $closure->getCreditAmount() + $addAmount;
        $closure->setCreditAmount($amount);
    }