James Parsons wrote: > Ok here go's , I'm just starting to Learn Perl and it's a very slow > process. > > I have this script the calculates the sum a bunch of numbers and > prints the final number to file, but my problem is I would like the > number to have a floating $sign but I'm sure how do this > > Any help would be great > > > Script: > > #!/usr/bin/perl -w > > use strict; > > my $total = 0; > > open(FILE,"/usr/local/logs/pos/dollar_me") || die $!; > > $total += $_ while(<FILE>); > > close(FILE); > > printf ("%7.2f\n",$total); > my $MyLen = length($total); printf "\$%${MyLen}.2f\n", $total;
Output: $120.23 Wags ;) ********************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. **************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]