Basic HTML version of Foils prepared Sept 20 97

Foil 35 Basic Output

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


We have already seen how to use print to output lists:
print @argfiles; # or you can use parentheses
print (@argfiles);
As in C, one can obtain format control with printf, which starts with a special purpose format specifier:
printf ("%10s %6d %10.2f\n", $string, $decimal, $float);
  • prints three variables with
    • $string in a 10 character string field,
    • $decimal in a 6 character integer format and
    • $float in a ten character field with two decimal places



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997