Percent printing in CGI...

2002-02-14 Thread Jerry Everett Jr

Hello,

I am having a problem printing percents within my PERL program when I add in
CGI.

Here the PERL program works great when printing.

printf "Percent Addresses Used . . . " . "%2.0f%%\n", $percentused;

PERL output

Percent Addresses Used . . . 59%

Here I have added the CGI to the PERL.

printf p("Percent Addresses Used . . . " . "%2.0f%%", $percentused);

CGI output

Percent Addresses Used . . . 0% 58.7301587301587

Please help.  How do I get the CGI output to print like the PERL output in this
case?

Jerry Everett





Re: Percent printing in CGI...

2002-02-14 Thread Briac Pilpré

On Thu, 14 Feb 2002 at 19:46 GMT, Jerry Everett Jr wrote:
> I am having a problem printing percents within my PERL program when I
> add in CGI.

 You have a problem with your parens in the printf function.

#!/usr/bin/perl -w
use strict;
use CGI qw(:html);

for my $percent ( 0.5, 5.434, 12.12, 100 ){
printf(p('2.Percent addresses used: %2.0f%%'), $percent)
}

__END__
-- 
briac
 << dynamic .sig on strike, we apologize for the inconvenience >>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]