Re: [OFFTOPIC] Perl scripts

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 11/18/97

On Tue, 18 Nov 1997, Chris Jacobson wrote:

> I use a Perl script by Patrick Dughi for cleaning out ASCII pfiles... all
> it does right now is check for the Deleted flag.  However, I was
> wondering if it was possible to add in a check for Levl: # being less
> than a certain number, and the file being older than, say, 30 days.
> Is this possible?  If so, anyone care to give me a small snippet of code?
>  I know no Perl :-)
way up top, add

$LEVEL_DEL=10;               # level to delete after 30 days.

        Add this in find_and_remove after
    if (/Id  /) {

                add these lines:

    if (/Last/) {
    if (/Levl/) {

    and then, right before the close(PFILE) line, add

/* check for level being less than a certain number, and the character not
        having logged in for about a month */
  if ((time() - $lastnum) > (60*60*24*30)) && ($levlnum < $LEVEL_DIR)) {
    #then, its more than a month

                        Huzzzah. It is done.


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/08/00 PST