#!perl HELP1 "withdraw " => "Withdraw from your account"; sub command :Tab(withdraw) ($self, $cart, $command, @) { $command eq 'withdraw' or return NEXT; return "Amount to withdraw from your account", \&amount; } sub amount($self, $cart, $arg, @) { my $amount = parse_amount($arg); defined $amount or return REJECT, "Invalid amount"; $cart ->add(-$amount, "Withdrawal", { is_withdrawal => 1 }) ->add_contra("-cash", +$amount, "Withdrawn by \$you"); return ACCEPT; }