in reply to There has got to be a Cleaner Way!

Two comments:

  1. Check the return values of close calls as well as open. You'll probably also want to print $! in the message.
  2. I always keep system files in an RCS repository. This has saved my butt only once, but when it did, I was most grateful. You could use the Rcs module, but it's probably overkill; something like
    system("ci -l -m 'adding user $username\@$domain' $datafile") == 0 or die "RCS check-in of $datafile failed: $?\n";
    should suffice. (Note: haven't tested the error checking; I just pulled that out of perldoc -f system.)

--
F o x t r o t U n i f o r m
Found a typo in this node? /msg me
The hell with paco, vote for Erudil!

Replies are listed 'Best First'.
Re: Re: There has got to be a Cleaner Way!
by jimbobn (Novice) on Aug 31, 2002 at 18:40 UTC
    how would you go about doing the above? there must be a better way than the way i am using