develooper Front page | perl.beginners | Postings from February 2002

Minor issues with format()

Thread Previous
From:
gkhgkh
Date:
February 26, 2002 09:44
Subject:
Minor issues with format()
Message ID:
20020226174431.EZDY2626.rwcrmhc51.attbi.com@rwcrwbc56
The only problem I have with the following script is it 
does not print the header information on the first 
page.  I must have missed something.  

I would appreciate any comments/suggestions.

Thanks

#!/usr/bin/perl -w

use strict;

use constant PATH 
=> "/usr/local/scripts/security/sybase/user/";
use constant GROUPS => "group_files.doc";
use constant ACCESS => "user_access_all.doc";

my $user;

open F_GROUPS, PATH.GROUPS    or die "Can't open:  $!";

while (<F_GROUPS>) {
    chomp(my @field = split /:/);
    
    open OUT, ">$field[1]"  or die "Can't open:  $!";
    open F_ACCESS, PATH.ACCESS    or die "Can't open:  
$!";
    
    while (<F_ACCESS>) {
        chomp ();        
        $user = $_;        
        write OUT if (/$field[0]/);
    }
    
format OUT_TOP =

||||||||||||||||||||Company Name||||||||||||||||||||||
||||||||||||||||||||Report Title|||||||||||||||||||||||||

Security Group              First Name                
Last Name
..

format OUT = 
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$user,
..

    
        
    close OUT                   or die "Can't close:  
$!";
    close F_ACCESS              or die "Can't close:  
$!";

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About