#!/usr/bin/perl print CalcBalance(\"balance.log"); sub CalcBalance { my ($balance, @log); my $location = 0; #because my $location = shift(@ARGV) does not wok either. $location = shift(@ARGV); # the following is not needed # open (RBALANCE, $location); # @log = ; # $balance = $log[-1]; # close (RBALANCE); # if (@ARGV && $ARGV[0] != 0) { # we check to see if there is another # # argument (the amount to change) and # # it is not 0. # # my $toChange = shift (@ARGV); # we only declare this if another # # argument exists to make the test # # above work. # $balance += $toChange; # open (WBALANCE, ">>$location"); # print WBALANCE $balance; # close (WBALANCE); # } }