in reply to Questions with sysopen (code)

The immediate problem is this line:
foreach my $readLine (PASSWD) {
Perhaps you meant something like <PASSWD>?

However, you should never do this:

truncate (PASSWD, 0);
with an important file like passwd! What you do is write a new file that has the changes you want and then mv the new file over the old file.

Replies are listed 'Best First'.
Re: Re: Questions with sysopen (code)
by RMGir (Prior) on Sep 19, 2002 at 19:38 UTC
    ...after cp'ing the old file to passwd.bak, just in case your script REALLY screws up...
    --
    Mike