programming-examples/perl/Report/Write a format to a file.pl
2019-11-15 12:59:38 +01:00

24 lines
510 B
Perl

format standardformat_top =
Employees
First Name Last Name ID Extension
--------------------------------------------
.
format standardformat =
@<<<<<<<<<<<<@<<<<<<<<<<<<@<<<<<<<<@<<<<
$firstname $lastname $ID $extension
.
$firstname = "B";
$lastname = "A";
$ID = 1234; $extension = x456;
open FILEHANDLE, ">report.frm" or die "Can't open file";
select FILEHANDLE;
select FILEHANDLE;
$~ = standardformat;
$^ = standardformat_top;
write;
close;