[17137] in Perl-Users-Digest
Perl-Users Digest, Issue: 4549 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 7 14:10:26 2000
Date: Sat, 7 Oct 2000 11:10:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970942211-v9-i4549@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 7 Oct 2000 Volume: 9 Number: 4549
Today's topics:
Poor Responses - Different Ways to Obtain a Client`s IP <dontmail@me.com>
Re: Poor Responses - Different Ways to Obtain a Client` (Richard Lippmann)
Re: Poor Responses - Different Ways to Obtain a Client` <flavell@mail.cern.ch>
Re: Poor Responses - Different Ways to Obtain a Client` <dontmail@me.com>
Problem Solved - Different Ways to Obtain a Client`s IP <dontmail@me.com>
Re: Reading textfiles from client? <juex@my-deja.com>
Re: regexp problem <ves@ves.net>
Re: Reverse by paragraphs - NOT! ollie_spencer@my-deja.com
Re: Script sends mail, only get header!! <dean_j_pompilio@yahoo.com>
Re: Script sends mail, only get header!! (Richard Lippmann)
Re: Win32::SerialPort Tutorial? (Bbirthisel)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 7 Oct 2000 16:52:15 +0100
From: "Philip Lancefield" <dontmail@me.com>
Subject: Poor Responses - Different Ways to Obtain a Client`s IP ?
Message-Id: <39df4756.0@d2o313.teliauk.com>
I am disappointed by the responses I am getting, ranging from Nico F
Zigouras (manners an optional extra) who replied with -
Here`s my question. I want to record the IP addresses of people visiting my
... Here's my answer: this isn't a Perl question.
<snip the rest of the totally unrelated crap>
Since I asked how to use Perl to connect to client ports I fail to see how
this is not a Perl question. To a bunch of responses telling me to use
environmental variables. I stated that I wanted to take another approach did
anyone who responded actually read the post ?
------------------------------
Date: Sat, 07 Oct 2000 16:14:07 GMT
From: richard.lippmann@sprachtheorie.de (Richard Lippmann)
Subject: Re: Poor Responses - Different Ways to Obtain a Client`s IP ?
Message-Id: <39ea4a6d.26578227@news.franken.de>
On Sat, 7 Oct 2000 16:52:15 +0100, "Philip Lancefield"
<dontmail@me.com> wrote:
>I am disappointed by the responses I am getting, ranging from Nico F
>Zigouras (manners an optional extra) who replied with -
>
>Here`s my question. I want to record the IP addresses of people visiting my
>... Here's my answer: this isn't a Perl question.
><snip the rest of the totally unrelated crap>
>
>Since I asked how to use Perl to connect to client ports I fail to see how
>this is not a Perl question. To a bunch of responses telling me to use
>environmental variables. I stated that I wanted to take another approach did
>anyone who responded actually read the post ?
Philip, your question was:
> Here`s my question. I want to record the IP addresses
> of people visiting my site. The simple way to do this is
> to use the environmental variables the client browser
> provides. However, there may be occasions when a
> visitor is using a proxy to disguise their real IP address.
> For security reasons it is important that I obtain the
> real IP address of the person. I know that, for
> instance, you can obtain the real IP of a user who
> is using a proxy for HTTP and FTP by connecting
> to the security port. So what I would like the answer
> to is - [...]
The simple, friendly answer is that you cannot find out always and in
every circumstance the IP-address of a machine connecting your
webserver. A proxy server fetches itself the webpage for its client
machine and gives the fetched information to its client.
The security mechanism you want to build upon IP-addresses simply will
not work. You have to try another thing like ssl, login with
user/password, setting cookies... There are some possibilities to
check the user at the other side.
Please read the answers of the people well. They granted you a few
minutes of their lives. Also answers which sound unfriendly have
informations included (especially in this thread) which you can use.
Good luck with your project.
From Bavaria, Germany
Horshack
------------------------------
Date: Sat, 7 Oct 2000 18:42:48 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Poor Responses - Different Ways to Obtain a Client`s IP ?
Message-Id: <Pine.GHP.4.21.0010071830310.10719-100000@hpplus03.cern.ch>
On Sat, 7 Oct 2000, Philip Lancefield wrote:
> I am disappointed by the responses I am getting,
and we're disappointed that you haven't understood the careful and
competent answer that you got from Martien, for one example.
> Since I asked how to use Perl to connect to client ports I fail to see how
> this is not a Perl question.
This kind of behaviour is typical of people who don't understand how
things work. If I programmed my tax calculations in perl, would you
expect me to ask questions about permissible deductions and
save-as-you-earn schemes on the Perl group? It makes as much sense.
There's some rather restricted circumstances where your question could
be meaningful, if asked on an appropriate group, say, in the WWW
hierarchy.
> To a bunch of responses telling me to use
> environmental variables. I stated that I wanted to take another approach did
> anyone who responded actually read the post ?
Right, that's another entry in the scorefile.
--
"Do those last words actually hold more water than those uttering them"
- from a posting to alt.possessive.its.has.no.apostrophe
------------------------------
Date: Sat, 7 Oct 2000 18:40:29 +0100
From: "Philip Lancefield" <dontmail@me.com>
Subject: Re: Poor Responses - Different Ways to Obtain a Client`s IP ?
Message-Id: <39df609b.0@d2o313.teliauk.com>
Alan on my newserver there is _no_ post from anyone with the name Martien so
I have no idea whether his answer was careful or competent. Asking whether a
language has the _capability_ to carry out a task (obtainng IP addresses) is
not the same as asking about permissable deductions in any sense.
Alan J. Flavell wrote in message ...
>On Sat, 7 Oct 2000, Philip Lancefield wrote:
>
>> I am disappointed by the responses I am getting,
>
>and we're disappointed that you haven't understood the careful and
>competent answer that you got from Martien, for one example.
>
>> Since I asked how to use Perl to connect to client ports I fail to see
how
>> this is not a Perl question.
>
>This kind of behaviour is typical of people who don't understand how
>things work. If I programmed my tax calculations in perl, would you
>expect me to ask questions about permissible deductions and
>save-as-you-earn schemes on the Perl group? It makes as much sense.
>
>There's some rather restricted circumstances where your question could
>be meaningful, if asked on an appropriate group, say, in the WWW
>hierarchy.
>
>> To a bunch of responses telling me to use
>> environmental variables. I stated that I wanted to take another approach
did
>> anyone who responded actually read the post ?
>
>Right, that's another entry in the scorefile.
>
>--
>
> "Do those last words actually hold more water than those uttering them"
> - from a posting to alt.possessive.its.has.no.apostrophe
>
>
------------------------------
Date: Sat, 7 Oct 2000 18:56:25 +0100
From: "Philip Lancefield" <dontmail@me.com>
Subject: Problem Solved - Different Ways to Obtain a Client`s IP ?
Message-Id: <39df6457.0@d2o313.teliauk.com>
I have checked Deja News and found the post from Martien. For whatever
reason my newserver does not contain this message so I have been unable to
respond to it. While all the other posters have had access to it I have been
left in the dark. Yes it is a reasonable answer which was all I was looking
for, however I still feel the average response was not that helpful.
------------------------------
Date: Sat, 7 Oct 2000 08:20:19 -0700
From: "Jürgen Exner" <juex@my-deja.com>
Subject: Re: Reading textfiles from client?
Message-Id: <39df3fb0@news.microsoft.com>
"Bas Welvering" <kpn_bw@hetnet.nl> wrote in message
news:OSMglp3LAHA.319@net025s...
> I want to make a page,
Perl doesn't have pages
> with an input field on it,
Perl doesn't have input fields
> where visitors can select
Perl doesn't have visitors
> a textfile stored on their computer.
> Then I want to process this textfile, without uploading it, I just want
the
No idea what you mean with uploading
> textfile to be stored in an array.
> Does anyone know how to do this?
open (MYFILE, "filename") or die "some useful error message";
@myarray = <MYFILE>;
jue
------------------------------
Date: Sat, 07 Oct 2000 09:01:01 -0700
From: Vespasian <ves@ves.net>
Subject: Re: regexp problem
Message-Id: <dUjfOQneih7QMIpyIpGutHmtQ0io@4ax.com>
Here's what I would do
my $str = "dir1/dir2/dir3/file_name.html";
my $str1 = "Dir2/Dir3/File Name.HTML";
s/$str1/$str/g;
that should do it
On Tue, 19 Sep 2000 12:06:02 -0700, Larry Rosler <lr@hpl.hp.com>
wrote:
>In article <39C75C29.BE49DD79@green-it.com.au> on Tue, 19 Sep 2000
>23:29:29 +1100, Richard Green <richard@green-it.com.au> says...
>+
>+ I'm new to regular expressions, so any help with this is much
>+ appreciated to solve this problem, which arises from a script to sort
>+ out a web site which was made on Windoze and need to be tidied up
>+ before moving to a UNIX system.
>+
>+
>+ $_ = "Some other stuff then ../Dir2/Dir3/File Name.HTML
>+ and again ../Dir2/Dir3/File Name.HTML ";
>+
>+ I want to replace the matching right hand side part of the string
>+
>+ "/Dir1/Dir2/Dir3/File Name.HTML"
>+
>+ with the equivalent right hand side part of
>+
>+ "/dir1/dir2/dir3/file_name.html"
>
>What does 'right hand side part' mean in relation to these two strings?
>
>+ thus returning $_ as
>+
>+ "Some other stuff then ../dir2/dir3/file_name.html and
>+ again ../dir2/dir3/file_name.html "
>+
>+ The two strings used in the substitution are known, and always have
>+ the same number of characters, so it is a matter of matching the right
>+ most part of the test string and substituting it with a similar number
>+ of characters from the right-hand side of the substitution string.
>+
>+ If it isn't possible to substitute using s/// matching and returning
>+ the position and length of the substring would be ok.
>
>The biggest problem I see here is delimiting the strings that represent
>the filenames to be modified. Here is a simple approach that will
>perhaps help you cook up what you are really after:
>
> s!(\.\./.+\.HTML)\b!(my $x = $1) =~ tr/ A-Z/_a-z/; $x!eg;
>
>+ Thanks & regards
>+
>+ Richard Green
>+ In Olympic Sydney 2000
>
>How nice! It must be hard to pay attention to Perl under those
>circumstances.
------------------------------
Date: Sat, 07 Oct 2000 16:50:01 GMT
From: ollie_spencer@my-deja.com
Subject: Re: Reverse by paragraphs - NOT!
Message-Id: <8rnk7o$du9$1@nnrp1.deja.com>
>
> Stop posting your answers before the original question. In
> time-honored Usenet tradition, quoted material comes *ahead of* or
> *interspersed* with the response. Take a look at 90% of the other
> postings. The other 10%, we call "jeopardy posts" because they mimic
> the old game show. These are frowned upon, because they cause an
> unnatural reading flow. Yours are in this category, and make you seem
> ignorant or disagreeable (we can't tell which).
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
Thank you for your answer. I will happily comform to whatever norm
is in vogue. I just want technical dialog with personalities
left out.
FWIW:Less than 2 years ago I was severely criticised for posting
non-jeopardy fashion(i.e., my new message "at bottom") in company
e-mails! The execs like their meat upfront, I guess.
That was my template. If you've had the stomach to follow this thread,
you know my other stupidities.
But I've not been stupid enough to ignore your books.
Thanks again.
ollie spencer
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 07 Oct 2000 15:38:43 GMT
From: Dean J. Pompilio <dean_j_pompilio@yahoo.com>
Subject: Re: Script sends mail, only get header!!
Message-Id: <8rng24$asm$1@nnrp1.deja.com>
In article <slrn8tsv32.jr6.mgjv@martien.heliotrope.home>,
mgjv@tradingpost.com.au wrote:
> On Fri, 06 Oct 2000 23:35:03 GMT,
> Dean J. Pompilio <dean_j_pompilio@yahoo.com> wrote:
> > I have a perl script which mails an output file to my account on
> > another Unix box. Here are the two commands I have tried:
> >
> > `cat $outfile | mailx -s $outfile me\@unix.com`;
> >
> > system("cat $outfile | mailx -s $outfile me\@unix.com");
>
> Why are you treating Perl as a shell script language? There are many
> modules out there that can do this for you.
The email command is just the last function of a much larger script. I
don't think using another module is prudent in this case...
>
> Have you thought about what happens if
>
> $outfile = '; rm -rf /;';
>
> ? Do you know what happens now? Why are you using cat? Why are you
using
> mailx, which is not available on that many systems? Have you read the
> perl FAQ?
I can appreciate your position on this, but my script is only going to
run on HP Unix servers. I don't really care about any other
platforms...
>
> # perldoc -q 'send.*mail'
> Found in /opt/perl/lib/5.6.0/pod/perlfaq9.pod
> How do I send mail?
> [SNIP]
>
I'll definitely check the faq for future ideas.
> > If I run the command from the shell, everything works just fine.
Any
> > ideas Perl/Unix gurus????
>
> Yep. Don't use cat unnecessarily. If you must use mailx, read its
manual
> page. But... Don't use mailx. If you must directly use an external
> program, use sendmail (and realise that sendmail may not be in the
> user's path). But, to avoid making silly mistakes, just use one of the
> modules from CPAN
Actually, a friend of mine came up with the solution. My problem was
caused by not closing the filehandle for the output file. Doh!! Of
course it's impossible to mail the file if it is still open... live
and learn!
>
> http://search.cpan.org/
> http://www.cpan.org/
>
> Oh, and READ this group before you post. The question 'ho do I send
> email' comes up at least once a week here. It's probably the most FAQ
> there is. Almost.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division |
> Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
> NSW, Australia |
>
Thanks for taking the time to point me in the right direction Martien.
-Dean
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 07 Oct 2000 16:02:18 GMT
From: richard.lippmann@sprachtheorie.de (Richard Lippmann)
Subject: Re: Script sends mail, only get header!!
Message-Id: <39e94899.26110645@news.franken.de>
On Sat, 07 Oct 2000 15:38:43 GMT, Dean J. Pompilio
<dean_j_pompilio@yahoo.com> wrote:
>In article <slrn8tsv32.jr6.mgjv@martien.heliotrope.home>,
> mgjv@tradingpost.com.au wrote:
>> On Fri, 06 Oct 2000 23:35:03 GMT,
>> Dean J. Pompilio <dean_j_pompilio@yahoo.com> wrote:
>> > I have a perl script which mails an output file to my account on
>> > another Unix box. Here are the two commands I have tried:
>> >
>> > `cat $outfile | mailx -s $outfile me\@unix.com`;
>> >
>> > system("cat $outfile | mailx -s $outfile me\@unix.com");
>>
>> Why are you treating Perl as a shell script language? There are many
>> modules out there that can do this for you.
>
>The email command is just the last function of a much larger script. I
>don't think using another module is prudent in this case...
Try reading this
http://www.franken.de/users/lisa/horshack/perl/index.html#mail
Should work for you. Mailing is an often used function, it's worth you
write a little wrapper-module which you use only on your systems.
Greetings from Bavaria, Germany
Horshack
------------------------------
Date: 07 Oct 2000 16:24:59 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Win32::SerialPort Tutorial?
Message-Id: <20001007122459.23807.00000696@ng-cp1.aol.com>
Hi Phil,
>Have you any examples of how to use program modems in
> asynchronous mode.
>on unix. ie. have 2 chanels/devices for the one com port, one for input
>and another for output.
I haven't tried that combination. I have run multiple ports from a single
channel. The closest I have tried to separate input and output channels
is the Tk-based example. The data paths are mostly separate in that
one - although they resolve to a single "device".
> Also do you know how to do a non blocking read
>on the device so that I can write to it at the same time?
That capability is built in to the Win32:: version. It can be done in the
Device:: version with 'input'. Again the Tk example would be a starting point.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4549
**************************************