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

Minor issues with format()

Thread Previous
February 26, 2002 09:44
Minor issues with format()
Message ID:
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.


#!/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 = 

    close OUT                   or die "Can't close:  
    close F_ACCESS              or die "Can't close:  

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About