Hi all,

Can anyone see why the following code:

#   Name: updateReferrer
#  Usage: updateReferrer( $site, $referrer );
#   Desc: Reads the referrer tally hash in from file, updates the count
for
#         $referrer and then writes the hash back to file.
# Return: n/a
sub updateReferrer ($$) {
    my $site = shift;
    my $referrer = shift;

    my %referrerTally = ();

    # Set referrer to unknown if it is null
    if ( $referrer eq "" ) {
        $referrer = "unknown";
    }

    # Read in the existing tally from file (if possible)
    if ( open( FD, "<$Globals::DATA/$site/$Globals::REFTALLY" )) {

        while ( <FD> ) {

            chomp;
            my ( $referrerName, $count ) = split;
            $referrerTally{$referrerName} = $count;
        }
        close( FD );
    }

    # Update the appropriate count.
    $referrerTally{$referrer}++;

    # Write the tally back to file.
   #**************Error occurs here (on open)***************
    if ( open( FD, ">$Globals::DATA/$site/$Globals::REFTALLY" )) {

        for my $referrerName ( sort keys %referrerTally ) {
            print FD "$referrerName $referrerTally{$referrerName}\n";
        }
        close( FD );
    }
}

returns the following error:
Insecure dependency in  open while running with -T switch at
F:/breezy/dev/perl/Hit/lib/Hit.pm line 196.

Any help would be much appreciated:)

Toot! Toot!

Breezy



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to