I run http://www.lrsehosting.com, a small slash and scoop hosting business. I'd like to play a more active role in the business (other than just book keeping and sales, basically) and help the admins out (and myself) and be more productive, so I have to learn perl. What a better way to do that then to write something I need written?
I know what I want to do - I need a script that will add users to Password.pm for me, and I'd like to try and write that script. With the help of a friend, I've managed to figure out how to make the script always fine the correct file, and set it as $filepath. At that point, I'm completely lost. The way the module currently works, you setup one or more virtual users at install, and you then have to find and hand edit the file thereafter. That sucks. Hard. So, the following is what I have to date, and from here I'd like some idea(s) on how to make it (a) check to see if the user you want to add already exists, (b) add that user if not and (c) remove a user with a command like argument (like -delete foo):
#!/bin/perl # # addvirtu.pl by William Scott Lockwood III and Peter Johnson # use DBIx::Password; my $filepath = $INC{"DBIx/Password.pm"};
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |