![]() |
Defining a Report Template![]() ![]() ![]() ![]() ![]()
The format function defines the format of the report. The write function prints the report - you can print to the standard output or any other file, Using the format function
You use the format function to specify the layout of a report. The syntax of the file format function is as follows :
The first line starts with the format function, which is followed by a name for this report template. The name of the format should be the same as the name of the filehandle where the report is printed. If you omit the filehandle, NAME is assumed to be STDOUT (in other words, the report is being printed on standard output). The format definition ends with a line containing a single period. Between the first and last lines, you can have some comment lines - the convention is the same as other Perl comments ; a comment line begins with a #. Besides the comments (which may explain the layout of the report), the format specification contains pairs of PICTURE LINE and ARGUMENT LINE. Each PICTURE LINE defines the layout of a line in the report. Special symbols designate fields, the amount of space assigned to a field, and the alignment of the value (for example, right - justified) in the field. The ARGUMENT LINE immediately following a PICTURE LINE provides the arguments that are used for that line of output. However, nothing happens as a result of the format function ; the result occurs only when the write function is called to generate the report. That means you can place the formats anywhere in the program, It's a good idea, however to keep them all together in one-place - either at the beginning or at the end of a program.
|
|
PERL Perl Program Data Types Types of Variables Operator Types Functions String Functions Array Functions Expressions Statement Blocks The if Statement Unless Statement While Loops Until Loop For Loop Foreach Loop Jump Keywords Subroutines Perl References Die Function Exit Function Localtime Function Standard Files File Test Operators File Functions Opening Files Reading into Hash Printing Revisited Globbing Splitting a Record into Fields Perl's Special Variables Regular Expression Simple True-False Searches Inexact Matches in Regular Expressions Matching Any Character Characters with Class Special Locations Quantifiers Greedy Matching Modifiers Localtime Function Subsituations Letter for Letter Translations Generating A Simple Report Defining a Report Template Specifying the Picture Line Specifying the Argument Line Adding a Header Writing the ReportDomain Names Home Importance of a domain name How does a web domain name work? Domain name syntax Choosing a domain name Domain Transfer Domain Parking IP AddressWeb Design HTML DHTML XML JAVASCRIPT VBSCRIPT PHOTOSHOPWeb Hosting Web Server Web Server Software Microsoft Internet Information Server Web hosting ISP Shared web hosting Virtual web hosting Dedicated web hosting Web hosting colocation Managed web hostingE Commerce Principles of E-Commerce E-Banking Electronic Payment System E-Security Credit Cards Smart Cards
The Mailbox POP Server SMTP Server IMAP Protocol |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |