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


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

in Table To:


© 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