[EMAIL PROTECTED] wrote:

::    That "last;" statement makes certain of it. So, the second
:: email should be coming from a second instance of this script.
:: You need some mechanism to allow each instance of the script to
:: communicate with past instances or you'll need a better test
:: than elapsed time.
: 
: yes I know and this is proving to be a mind boggler.

    It shouldn't. First you need to decide on the scheme used to
store state. The Storable and Data::Dumper modules come to mind.
A thorough search of CPAN may find a more turnkey module.


# somewhere in code ($seen is a hash ref)
my $seen = fetch_state();

# somewhere else in code
# add string to seen strings
$seen->{$string}++;

# somewhere else in code
# remove string from seen strings
delete $seen->{$string};


# somewhere else in code
unless ( $seen->{$new_string} ) {
    # send email
    $seen->{$new_string}
}


# somewhere else in code
sub store_state {
    my $seen = shift;
    # lock a file, open a file,
    # store the state, close a file,
    # return success
}

sub fetch_state {
    # lock a file, open a file,
    # fetch the state, close a file,
    # return data structure
    return $seen;
}

HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to