in reply to Help with database management

Greetings! I appreciate y'all for your help! Xanatax, would I be able to use your code for my predicament? I'm not a big Perl/scripting expert. I kind of understand what you wrote, but I'm not sure how I can apply it to solve my problem. Can you tell me how to get the db file into an array? So I think from then on I can get things started. Thanks again!!

Replies are listed 'Best First'.
Re: Re: Help with database management
by Xanatax (Scribe) on Feb 24, 2002 at 00:34 UTC
    yes, absolutely, use the code if it is useful.

    code to read file:

    # deal with absence of pwfile. unless ( -e $passwd ) { # PANIC, quit, etc. die("No passwd file found"); } # open file handle for read open(PASSWD, $passwd) or die("Cannot open passwd file for read."); # push each entry into an array while (<PASSWD>) { # remove the trailing \n chomp $_; # add line to array push (@pwfile, $_); } #close the file handle. close(PASSWD);


    then all your data is stored in @pwfile.