Basic HTML version of Foils prepared March 30 97

Foil 65 Example of a Format Definition (Chapter 11 of Llama Book)

From PERL4 Tutorial for CPS616 Computational Science for Information Age Course CPS616 -- February 1995. by Geoffrey C. Fox


$~ = "ADDRESSLABEL"; # sets format for current FILEHANDLE to ADDRESSLABEL
$FORMAT_NAME = "ADDRESSLABEL"; if use English
FILEHANDLE->format_name("ADDRESSLABEL"); if use FileHandle
format ADDRESSLABEL =
====================================
| @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
$name
| @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
$address
| @<<<<<<<<<<<<<<<<, @< @<<<<<<<<<<<<<< |
$city, $state,$zip
====================================
.
@ followed by N <'s specifies left justified field with N+1 characters in it.
write ; # outputs current values of $name,$address,$city,$state,$zip into 5 line template on currently selected file.



© 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 Sat Sep 6 1997