< source_code>
#!/usr/bin/perl system ('clear'); print DATA; while( ) { $sum+=$_; print $_; } print "--------\n"; print "$sum TOTAL\n"; __END__ 12.00 mini-saigon 12/21/2002 18.80 groceries 12/21/2002 18.86 groceries 12/22/2002 15.00 pho bac 12/24/2002 6.00 pike market 12/26/2002 34.73 groceries 12/27/2002</source_code>
> ./tiny_perl_spreadsheet.pl 12.00 mini-saigon 12/21/2002 18.80 groceries 12/21/2002 18.86 groceries 12/22/2002 15.00 pho bac 12/24/2002 6.00 pike market 12/26/2002 34.73 groceries 12/27/2002 -------- 105.39 TOTAL
No comments:
Post a Comment