Re: ip address substitution

2011-03-17 Thread Rob Dixon
On 16/03/2011 15:08, Shawn H Corey wrote: On 11-03-16 11:05 AM, John W. Krahn wrote: Jim wrote: $old_ip_address = 1.2.3.4; $new_ip_address = 5.6.7.8 $old_ip_address_regexp = $old_ip_address; $old_ip_address_regexp =~ s/\./\\./ig; $read_line =~

Re: ip address substitution

2011-03-16 Thread Brian Fraser
Assuming you are using strict and warnings, Use quotemeta or \Q\E[0] instead of trying to escape things manually... Your sanity will thank you. And yes, the \D* could be troublesome; it depends on the text you are matching against! For instance, 1.2.3.4.5 is not a valid IP, but you'd match and

Re: ip address substitution

2011-03-16 Thread Shawn H Corey
On 11-03-16 10:29 AM, Jim wrote: $old_ip_address_regexp = $old_ip_address; $old_ip_address_regexp =~ s/\./\\./ig; $old_ip_address_regexp = quotemeta( $old_ip_address ); See `perldoc -f quotemeta`. -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of

Re: ip address substitution

2011-03-16 Thread John W. Krahn
Jim wrote: I propose the following code will properly take the variable $read_line and substitute $new_ip_address for all occurrences of $old_ip_address. Basically the snippet of code is from some software that will update a set of old ip addresses with new ip addresses within a file. Can anyone

Re: ip address substitution

2011-03-16 Thread Shawn H Corey
On 11-03-16 11:05 AM, John W. Krahn wrote: Jim wrote: $old_ip_address = 1.2.3.4; $new_ip_address = 5.6.7.8 $old_ip_address_regexp = $old_ip_address; $old_ip_address_regexp =~ s/\./\\./ig; $read_line =~ s/(\D*)$old_ip_address_regexp(\D*)/$1$new_ip_address$2/ig; (\D*) won't work because it can

Re: ip address substitution

2011-03-16 Thread Jim
On 3/16/2011 10:49 AM, Brian Fraser wrote: Assuming you are using strict and warnings, Use quotemeta or \Q\E[0] instead of trying to escape things manually... Your sanity will thank you. And yes, the \D* could be troublesome; it depends on the text you are matching against! For instance,

Re: ip address substitution

2011-03-16 Thread Brian Fraser
/x does exactly what you think it does; It's free form style, where any non-escaped whitespace is ignored. See perlretut[0], perlop[1], and perlre[2]. (?!) is a negative lookbehind; (?!) is a negative lookahead. Meanwhile, (?=) is a positive lookbehind, and (?=) is a positive lookahead; They are

Re: IP address and Browser version.

2004-11-20 Thread Gary Stainburn
On Friday 19 November 2004 7:18 pm, Chris Devers wrote: On Fri, 19 Nov 2004 [EMAIL PROTECTED] wrote: I wanted to get the IP address and the OS of the system when some one checks in the page...How will I get the IP address and OS of the person who visits the page(with PERL CGI) As I was

Re: IP address and Browser version.

2004-11-19 Thread Chasecreek Systemhouse
On Fri, 19 Nov 2004 23:47:01 +0530 (IST), [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi I wanted to get the IP address and the OS of the system when some one checks in the page...How will I get the IP address and OS of the person who visits the page(with PERL CGI) Clients can lie to your

Re: IP address and Browser version.

2004-11-19 Thread Chris Devers
On Fri, 19 Nov 2004 [EMAIL PROTECTED] wrote: I wanted to get the IP address and the OS of the system when some one checks in the page...How will I get the IP address and OS of the person who visits the page(with PERL CGI) As I was saying the last time you asked a version of this question --

RE: IP address and Browser version.

2004-11-19 Thread Bob Showalter
[EMAIL PROTECTED] wrote: Hi I wanted to get the IP address and the OS of the system when some one checks in the page...How will I get the IP address and OS of the person who visits the page(with PERL CGI) Short answer: $ENV{REMOTE_ADDR} contains the client IP address

RE: IP address and Browser version.

2004-11-19 Thread Chris Devers
On Fri, 19 Nov 2004, Bob Showalter wrote: 1. The client IP address, which you can get by calling getpeername() on STDIN (or from REMOTE_ADDR environment variable). If the client is behind a proxy, you'd need to depend on the proxy adding something to the request headers. Moreover, nearly

Re: IP address

2002-06-07 Thread drieux
On Friday, June 7, 2002, at 09:41 , Shishir K. Singh wrote: I have a requirement to get the IP address of a user logged from a remote machine on to UNIX machine. Now the user can be using multiple logins through VPN or otherwise. I need to create something akin to command finger which

RE: IP address

2002-06-07 Thread Shishir K. Singh
for something which is shell/platform independent. Can it be done ?? -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 2:18 PM To: perl beginners Subject: Re: IP address On Friday, June 7, 2002, at 09:41 , Shishir K. Singh wrote: I have

Re: IP address

2002-06-07 Thread drieux
On Friday, June 7, 2002, at 11:28 , Shishir K. Singh wrote: But I want something akin to the value of $REMOTEHOST under tcsh. This can be generalized under unix by doing which is of course useful only to those running tcsh 8-) [..] but will not work under non Unix envi. Here comes in

RE: IP address

2002-06-07 Thread Timothy Johnson
: Re: IP address On Friday, June 7, 2002, at 11:28 , Shishir K. Singh wrote: But I want something akin to the value of $REMOTEHOST under tcsh. This can be generalized under unix by doing which is of course useful only to those running tcsh 8-) [..] but will not work under non Unix envi

RE: IP address

2002-06-07 Thread Timothy Johnson
To: begin begin Subject: Re: IP address On Friday, June 7, 2002, at 12:45 , Timothy Johnson wrote: For the Win32 command, something like `ipconfig` =~ /(\d+\.\d+\.\d+\.\d+)/; would work if you just want the ip address, providing you can have the client run it... I thought that merely

RE: IP address

2002-06-07 Thread Shishir K. Singh
My faultI meant the remote hostname. -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 4:38 PM To: 'drieux'; begin begin Subject: RE: IP address Maybe I misunderstood what he was asking. I thought he wanted to find out what

RE: IP address

2002-06-07 Thread Timothy Johnson
Oh, in that case (again clientside) you can check $ENV{COMPUTERNAME} unless the client is a Win9x system. -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 1:43 PM To: begin begin Subject: RE: IP address My faultI meant the remote

Re: IP address

2002-06-07 Thread David T-G
Shishir -- Would you mind doing us the favor of restating your requirements? So far we have - remote host where the user is sitting (some N hops away) - remote host from which the user connected (0 or 1 hop) - this host when connecting remotely and all of them, of course, have various

RE: IP address

2002-06-07 Thread Shishir K. Singh
it for the time being by putting the following in my ..cshrc (cshell) by doing setenv DISPLAY `who -m | sed 's/.*(\(.*\))$/\1/'`:0.0 -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 5:12 PM To: perl beginners Cc: Shishir K. Singh Subject: Re: IP

Re: IP address

2002-06-07 Thread David T-G
Shishir -- ...and then Shishir K. Singh said... % % Okay ...the scenario was... % % % I telnet from my PC (remote host) to a UNIX machine with user ABC. Now I So this is for your benefit rather than tracking down some other user, right? OK; good to know. % can login from another PC on the

Re: Ip address

2002-04-11 Thread drieux
On Wednesday, April 10, 2002, at 06:58 , Jorge Goncalvez wrote: Hi, I tried to get the IP address in a Win98 machine I made a perl module and I put it in /site/lib with .pm extension. it is Registry98.pm But I have this error: Can't call method Open of a undefined value at Registry98.pm

RE: Ip address

2002-04-10 Thread Smith, Jim R
Where does Open (upcase O) come from. Did you mean to use open (lowcase o) ? -Original Message- From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 9:58 AM To: [EMAIL PROTECTED] Subject: RE:Ip address Hi, I tried to get the IP address in a Win98 machine I

Re: IP Address

2002-04-04 Thread Randal L. Schwartz
David == David Gray [EMAIL PROTECTED] writes: How do I get the IP address from a POST form. Let me make myself more clear: I have a form that uses POST, and I would like to get users' IP address for avoiding the same user to fake my pool's result. David You can check $ENV{REMOTE_ADDR},

Re: IP Address

2002-04-04 Thread Rafael Cotta
A user is not an IP address A user is not an IP address A user is not an IP address Imagine if my mom were called 200.224.110.105. LOL. Ok, good point, but my IP address approach will be enough, once my system doensn't need to be very accurate. The data processing

Re: IP Address

2002-04-04 Thread Randal L. Schwartz
Rafael == Rafael Cotta [EMAIL PROTECTED] writes: Rafael Ok, good point, but my IP address approach will be enough, Rafael once my system doensn't need to be very accurate. Except that it will be frustrating to the second employee at motorola.com who wants to vote after the first one has

RE: IP Address

2002-04-04 Thread Scot Robnett
PROTECTED] -Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 3:18 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: IP Address David == David Gray [EMAIL PROTECTED] writes: How do I get the IP address from a POST form. Let me

Re: IP Address

2002-04-04 Thread Connie Chan
Why don't simply use cookie ? or when a page is open, redirect to : youscript.cgi?ip=xxx.xxx.xxx.xxxwhateverParams=whateverVar (you may use your way to encrypt ip the ip address) Or if you want to avoid duplicate click on Submit, you can use javascript to disable the submit button when it

RE: IP Address

2002-04-04 Thread David Gray
David == David Gray [EMAIL PROTECTED] writes: How do I get the IP address from a POST form. Let me make myself more clear: I have a form that uses POST, and I would like to get users' IP address for avoiding the same user to fake my pool's result. David You can check

RE: IP Address

2002-04-04 Thread Michael Gargiullo
] Subject: Re: IP Address Rafael == Rafael Cotta [EMAIL PROTECTED] writes: Rafael Ok, good point, but my IP address approach will be enough, Rafael once my system doensn't need to be very accurate. Except that it will be frustrating to the second employee at motorola.com who wants to vote after

Re: IP Address

2002-04-04 Thread Rafael Cotta
No problem. I'll place a big sign on my website's main page banning AOL users and Motorola employees... Rafael Randal L. Schwartz [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Rafael == Rafael Cotta [EMAIL PROTECTED] writes: Rafael Ok, good point, but

Re: IP Address

2002-04-04 Thread Mo Holkar / UKG
At 18:32 04/04/02, Randal wrote: Voting on the net is always a joke. Like the man said. You can't prevent fraud, all you can do is choose what level of inconvenience you want would-be-fraudulent users to go to. But if the poll is over something that people aren't going to be too motivated

RE: IP Address

2002-04-03 Thread David Gray
How do I get the IP address from a POST form. Let me make myself more clear: I have a form that uses POST, and I would like to get users' IP address for avoiding the same user to fake my pool's result. You can check $ENV{REMOTE_ADDR}, which will contain the remote IP of the user hitting

Re: IP address from the registry

2002-01-10 Thread Briac Pilpré
Jorge Goncalvez wrote: Hi, Is there a way to obtain the IP address from the registry in Both Windows 98 and NT with Perl moduls. Dave Roth's GetIP script should do what you want, hopefully with a miminmum amount of tweaking: http://www.roth.net/perl/scripts/scripts.asp?GetIP.pl -- briac

Re: IP Address Reverse Lookup

2001-12-10 Thread Brett W. McCoy
On Mon, 10 Dec 2001, Brian wrote: If at all possible, which perl module would I need to call in order to perform a reverse lookup on an IP address? I need to produce something simalar to the host command ie: [brian@mustang brian]$ host 12.90.6.4 4.6.90.12.in-addr.arpa domain name pointer