CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Perl Report Example

 



Mcampb9713
Deleted

Apr 27, 2000, 11:49 AM

Post #1 of 2 (503 views)
Perl Report Example Can't Post

This is my first report in Perl... I want to report some files as they are parsed from a file... Does anyone have any sample code that I can use.. Its just a report like

Header datetime
field field2 field3 field4 field5
. . . . .

Footer

I want to print this report to a file as well as in Word and HTML format.

Please help.


gvh
Deleted

Apr 28, 2000, 3:13 PM

Post #2 of 2 (503 views)
Re: Perl Report Example [In reply to] Can't Post

This is one of the many easy things in perl. Just draw up some format lines, initialise your variables for each line to be printed and call write; (assumeing you print to STDOUT; you can of course always open a file and write tot that handle)

Your formats (for STDOUT) could look like these:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>



format STDOUT_TOP =

Whatever header text you may desire

@&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;
scalar localtime()

Item 1 Item 2 Item 3 Item 4 Item 5 Item 6
---------- ---------- ---------- ---------- ---------- ----------

.

format STDOUT =
@<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @<<<<<<<<<
$1, $2, $3, $4, $5, $6
.


</pre><HR></BLOCKQUOTE>

Have a look at the perlform manpage

I hope this helps.

pp2u
(Perl power to you)

[This message has been edited by gvh (edited 04-28-2000).]

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives