develooper Front page | perl.beginners | Postings from January 2002

Won't write IP address to file

Thread Next
From:
K.L. Hayes
Date:
January 16, 2002 12:24
Subject:
Won't write IP address to file
Message ID:
38191302685.20020116152231@coppercountry.com
Hello All,

Could somebody please help me figure out why the following code will
not write the IP address to a file?

I've verified that the code can find the file, open it & overwrite any
junk/test data already there with nothing. I've also printed out the
IP address on the previous page using just the print statement.

<CODE>
sub pcheck {
    if (param('pwd') eq $pw ) {
    open  (CHECK,">${path}dmp.dat") || die "Cannot open dmp.dat: $!";
    flock (CHECK, 2) if ($flock);
    while (<CHECK>) {
    print "$ENV{'REMOTE_ADDR'}"; }
    close (CHECK);
    flock (CHECK, 8) if ($flock);
    } else  { &invalid_info; }
    &ad2;
}
</CODE>

All help is appreciated. Thank you for your time.

-- 
Best regards,
K.L. Hayes
mailto:perl@coppercountry.com

+=====================================================+
+ "Only two things are infinite, the universe and     +
+ human stupidity, and I'm not sure about the former."+
+                                 -- Albert Einstien  +
+=====================================================+



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About