Help for this page

Select Code to Download


  1. or download this
    piggybank/brother.csv
    piggybank/sister.csv
    piggybank/mother.csv
    piggybank/test.csv
    
  2. or download this
    deposit;1
    beer;-30
    beer;-20
    won bet;200
    
  3. or download this
    deposit;1000
    buy coffee;-20
    buy lunch;-30
    new shoes;-500
    deposit;20
    
  4. or download this
    deposit;50
    deposit;30
    deposit;300
    small car accident;-550
    
  5. or download this
    #!/usr/bin/env perl
    use strict;
    ...
        
        print "Found data file $fname\n";
    }
    
  6. or download this
    #!/usr/bin/env perl
    use strict;
    ...
        }
        close $fh;
    }
    
  7. or download this
    sometext;value
    
  8. or download this
    sub readAccount {
        my ($fname) = @_;
    ...
        close $fh;
        print "$fname balance: $balance\n";
    }
    
  9. or download this
    #!/usr/bin/env perl
    use strict;
    ...
        print "$fname balance: $balance\n";
        return $balance;
    }
    
  10. or download this
    piggybank/brother.csv balance: 151
    piggybank/test.csv is not a file!
    piggybank/mother.csv balance: -170
    piggybank/sister.csv balance: 470
    Money left in the piggybank: 451