Removing uneeded file.
[and.git] / PC^2 / pc2admin / samps / sumit.pl
blob87c8bd19cd412148c1a46f5098bb0555847c5dad
3 # File: sum1.pl
4 # Purpose: to sum the integers in the file sumit.dat
5 # Author: pc2@ecs.csus.edu or http://www.ecs.csus.edu/pc2
7 # Sat Oct 30 13:20:59 PDT 1999
9 # caveat - this is not nice code, copy at own risk ;)
11 # $Id: sumit.pl,v 1.1 2005/03/06 05:13:57 laned Exp $
15 open (FP, "sumit.dat") || die "Could not open file sumit.dat\n";
17 $sum = 0;
19 while (<FP>)
21 chomp;
22 $num = 0 + $_;
23 $sum += $num if $num > 0;
26 print "Sum of positive integers is $sum\n";
28 # eof