Link to home
Start Free TrialLog in
Avatar of kesea
kesea

asked on

"ping" IP with PERL?

Hi Expert, Hope you are having a great day!!!

I was wondering if there is a way to find out a user of a website's IP, using PERL?

kesea
ASKER CERTIFIED SOLUTION
Avatar of jmcg
jmcg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pjaol
pjaol

If your running a large website, and you want to do statistics I'd look at the access logs of the web server
All web servers I know of, provide the ability to capture the remote address of a user in access logs.

If you wish to restrict users based upon IP again use your webserver for it, such as apaches'
 allow from ....
in it's config file.

But other than that if your just using it for informational or actual processing purposes the jmcg is correct!

p
Avatar of kesea

ASKER

I haven't had a chance yet to try jmcg's suggestion, but I was wondering, pjaol, if you could explain in more detail why its not good to use $ENV{REMOTE_ADDR} to do statistics or to restrict users based on IP?
I can't speak for Pjaol, but in general the reason to avoid writing your own Perl code for statistics gathering or access control is that it requires careful coding to get these things right in a CGI script (both to get them right so they do what you expect and also to get them so they don't do something bad when a user plays games with your script). The facilities already provided by the webserver for these functions should be preferred whenever possible.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Kesea, have you abandoned this question?

I see Ceppe has tried to answer the question you apparently were asking  in your question title rather than the question we thought you were asking in the question body.

If you're not happy with any of the answers, you can go to Community Support and ask that your points be refunded. I'd suggest that you request the moderators PAQ this question rather than delete it, since it contains answers that others with similar questions could benefit from in the future.