Thank you for your quick response.
Being a novice, I am not sure how to implement your responses.

Where in the code should I insert this? Here is the code (required fields are normally populated):

# This is the multicounter stats file $cntfile = ""; # To turn on logging $log = 1 else $log = 0 $log = 1; # If you want the counter output printed on your page $scrprint = 1 el +se 0 $scrprint = 1; # Location of your log file $logfile = ""; # Your own ip-address $own = ""; # -------------- Start program ----------------------------------- print "Content-type: text/html\n\n"; $date = localtime(time); open(INF,"$cntfile") || die "Can't open $cntfile to read: $! \n"; seek(INF,0,0); @data = <INF>; foreach $i (@data) { ($sitename,$counter,$ip_address) = split(/=/,$i); chop $ip_address; $sitename =~ s/ //g; $counter =~ s/ //g; $ip_address =~ s/ //g; $visitor = $ip_address; if ($sitename eq $ENV{'id'} && ($visitor eq $ENV{'REMOTE_ADDR'}) || ($ +own eq $ENV{'REMOTE_ADDR'})) { print $counter if ($scrprint eq "1"); exit; } else { if ($sitename eq $ENV{'id'}) { $counter++;<br> print $counter if ($scrprint eq "1"); open(ART,"$cntfile") || die "Can't open $cntfile to read: $! \n"; @data = <ART>; close(ART); open(ART,">$cntfile") || die "Can't open $cntfile to write: $! \n"; foreach $line (@data) { flock(ART,2); $line =~ s/$ENV{'id'} = [0-9]+ = [0-9]+.[0-9]+.[0-9]+.[0-9]+/$ENV{'id' +} = $counter = $ENV{'REMOTE_ADDR'}/g; print ART $line; } close(ART); if ($log eq "1") { open(OUTF,">>$logfile") || die "Can't open $logfile to write: $! \n"; print OUTF "$date | $ENV{'id'} | $counter | $ENV{'REMOTE_ADDR'} | $ENV +{'HTTP_REFERER'}\n"; close(OUTF); } } } }

In reply to Re^2: Use of uninitialized value in string eq by maxcross7
in thread Use of uninitialized value in string eq by maxcross7

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.