[12298] in Perl-Users-Digest
Perl-Users Digest, Issue: 5898 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 5 12:07:16 1999
Date: Sat, 5 Jun 99 09:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 5 Jun 1999 Volume: 8 Number: 5898
Today's topics:
Re: *****Learn PERL***** (Bob Trieger)
Re: Copying any files <gellyfish@gellyfish.com>
Re: Dating service script needed -matchmaker script <jester@isdead.aha>
Re: Does $' return the previous regexp's $' ? <hasant@trabas.co.id>
Re: execute perl on Windows NT via Netscape <gellyfish@gellyfish.com>
Re: how do i fucking run perl w32 (Chris Nandor)
Re: How to allow users to upload files on a server from (Bob Trieger)
Re: How to allow users to upload files on a server from <gellyfish@gellyfish.com>
Issuing remote commands without Telnet... <thurley@globalnet.co.uk>
Re: Newbie - would appreciate a hand to get started - T <jde222RemovethiS@iname.com>
Re: Newbie - would appreciate a hand to get started - T <jde222RemovethiS@iname.com>
Re: Newbie - would appreciate a hand to get started - T <jde222RemovethiS@iname.com>
Re: Newbie - would appreciate a hand to get started - T <gellyfish@gellyfish.com>
perl script to munge cmeli@cis.um.edu.mt
Re: problem clearing an array of array (Tad McClellan)
Re: replacing a word in a flat file (Abigail)
Re: sendmail doesn't work <gellyfish@gellyfish.com>
simple sendmail question <james.verrill@cwcom.net>
Re: simple sendmail question (Bob Trieger)
Re: The artistic license and perl: (Chris Nandor)
Re: Using Perl Modules (Bob Trieger)
Re: Using Perl Modules <dgris@moiraine.dimensional.com>
whats wrong with this script? (Cybernetic Bear)
Re: whats wrong with this script? <bill@fccj.org>
Re: whats wrong with this script? (Michel Dalle)
Re: whats wrong with this script? (Bob Trieger)
Re: whats wrong with this script? (Cybernetic Bear)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 05 Jun 1999 13:21:35 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: *****Learn PERL*****
Message-Id: <7jb6fq$ir4$1@fir.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
iliiiiiiii@aol.com (IlIIIIIIII) wrote:
>learn perl for free at http://illogic.cjb.net
I learned perl for free at http://www.perl.com and didn't have to wait 2
minutes to connect to an xoom site, then anothe3 minutes for a
linksexchange counter to figure out it is broken.
When this site finally loads, the color scheme (dark grey and blue on
black) is impossible to read.
I clicked on the "perl/cgi" link and once again the linksexchange
counter tries to connect for another 3+ minutes before it comes up as a
broken image. When the page finally loads it is nothing more than a
bunch of links to other peoples tutorials, You can find better links by
searching for the keywords "tutorial" and "perl" on any search engine.
Good luck!
------------------------------
Date: 5 Jun 1999 14:58:46 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Copying any files
Message-Id: <7jbdv6$4fu$1@gellyfish.btinternet.com>
On Sat, 5 Jun 1999 15:49:27 +0300 Alar Pandis wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
> news:7jb2gc$3ol$1@gellyfish.btinternet.com...
>> On Fri, 4 Jun 1999 19:19:22 +0300 Alar Pandis wrote:
>> > Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
>> > news:<3757f71c@newsread3.dircon.co.uk>...
>> >> Alar Pandis <Alar@mtk.ut.ee> wrote:
>> >> >
>> >> > Can You give example how can I use modules? I have file A and need
> copy
>> > this
>> >> > file into location B.
>> >> >
>> >>
>> >> perldoc File::Copy
>> >>
>> >
>> > I did that, but result is that by example Word-files or ZIP-files is
> copied
>> > not correctly. I got the same result if I did this via OPEN FILE and
> PRINT
>> > etc.
>> > What I am doing wrong? (With TXT-files is OK!, as usually.)
>> >
>>
>> If you look at the File::Copy documentation you will see that it is
>> possible to supply filehandles to the copy function - you will want to
>> do this after having applied binmode() to them.
>>
>
> I tried that (filehandles and binary) - no success, result is the same.
> Text-files is OK! (with not the same attributes, but in corpore), but binary
> files is differently.
>
Yes. On certain platforms including those from Microsoft, binary files
are distinguished from text files. In order to deal with binary files
properly on those platforms it is necessary to use the binmode() function.
You can read about the binmode() function in the perlfunc manpage. It is
also alluded to in the manpage for File::Copy.
perldoc -f binmode
perldoc File::Copy
If you after you have read the documentation and still are having problems
please can you post the smallest peice of working code that is behaving
as you describe for people to look at here - otherwise this could go
on forever.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 6 Jun 1999 00:54:59 +0930
From: "Jester" <jester@isdead.aha>
Subject: Re: Dating service script needed -matchmaker script
Message-Id: <Hta63.1668$H21.6856@ozemail.com.au>
Actually I just need a date who will service me. Whether she has a script or
not is irrelavant :-)
Jonathan Stowe wrote in message <7jasv8$3ki$1@gellyfish.btinternet.com>...
>On Fri, 04 Jun 1999 23:35:48 +0200 Mateo Byler wrote:
>
>> And just about anything you can think of that would be needed in
>> something like this.
>>
>
>Hmmm.
>
>/J\
>--
>Jonathan Stowe <jns@gellyfish.com>
>Some of your questions answered:
><URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
>Hastings:
<URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 5 Jun 1999 19:40:27 +0700 (JAVT)
From: Hasanuddin Tamir <hasant@trabas.co.id>
To: comp.lang.perl.misc@list.deja.com
Subject: Re: Does $' return the previous regexp's $' ?
Message-Id: <Pine.LNX.3.96.990605191151.15914A-100000@borg.intern.trabas.co.id>
On Fri, 4 Jun 1999, Lauren Smith wrote:
laurens] Date: Fri, 4 Jun 1999 19:09:09 -0700
laurens] From: Lauren Smith <laurens@bsqaure.com>
laurens] To: comp.lang.perl.misc@list.deja.com
laurens] Subject: Does $' return the previous regexp's $' ?
laurens] Reply-To: comp.lang.perl.misc@list.deja.com
laurens] Organization: WinStar NorthWest Nexus
laurens]
laurens] Here's what i've got:
laurens]
laurens] $_ = "This is XX something something YY my broken english.";
laurens]
laurens] if (/XX/) {
laurens] # Found pattern, pushing stuff onto the array
laurens] push (@array, $`);
laurens]
laurens] # Set $_ to trailing string
laurens] $_ = $';
laurens]
laurens] # Look for ending pattern, if not on this line, then on other lines
laurens] until (/YY/) {
laurens] $_ = <HEADER>;
laurens] }
laurens]
laurens] # Now put the string trailing the "YY" into the array
laurens] push (@array, $');
laurens] }
You can directly test the first $' for new matching.
Using your variable above (just a way):
if (/XX/) {
print $`;
if ($' = ~ /YY/) { ## $' from previous match, XX
print $', "\n"; ## $' is for the current macth, `YY'
}
}
Prints:
This is my broken english.
There's a simpler but not too safe way, specially
if the string mathces more than one time.
We use memory-parentheses:
($before, $after) =~ /(.*)XX.*YY(.*)/; ## or just $1 and $2
print "$before $after\n";
Prints:
This is my broken english.
( Note the extra whitespaces )
The problem arises if string before `XX', between `XX' and `YY',
and after `YY' also contains `XX' and/or `YY'. And you need
a non-greedy regex for that matter.
HTH,
-hasan-
uhm, no more sig(h)
------------------------------
Date: 5 Jun 1999 13:04:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: execute perl on Windows NT via Netscape
Message-Id: <7jb78p$446$1@gellyfish.btinternet.com>
On 2 Jun 1999 17:19:57 GMT j.k. wrote:
> Please help. How to execute the following prgram on Netscape. I use
> Windows NT4.0
>
Assuming you have a recent release of the Activestate distribution
installed there will be a bunch of documentation installed under a
link in your Start Menu - one of these documents describes how to
configure a variety of HTTP servers to run Perl scripts - if the
server you are using is not listed or indeed you dont have one running
then you should ask in comp.infosystems.www.servers.ms-windows - of
course they wont be interested in your script.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 05 Jun 1999 15:20:18 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: how do i fucking run perl w32
Message-Id: <pudge-0506991120250001@192.168.0.77>
I've never tried to program while engaged in that activity, so I can't
help, sorry.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Sat, 05 Jun 1999 13:28:52 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How to allow users to upload files on a server from their browser?
Message-Id: <7jb6tf$ir4$2@fir.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
smnayeem@my-deja.com wrote:
>I looked at the Net::Ftp module, there is a way for uploading the local
>file to the remote server, but my question is, i want users of my
>webpage to be able to upload files to me using the web, i am thinking of
>putting a button or someting and have a perl program connected to it
>that would fetch the local file and upload it to my server, but will it
>be local to the client who is uploading the file or local to the
>webserver that is running the script?
perldoc CGI
------------------------------
Date: 5 Jun 1999 12:55:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to allow users to upload files on a server from their browser?
Message-Id: <7jb6oh$441$1@gellyfish.btinternet.com>
On Sat, 05 Jun 1999 09:04:46 GMT smnayeem@my-deja.com wrote:
> I looked at the Net::Ftp module, there is a way for uploading the local
> file to the remote server, but my question is, i want users of my
> webpage to be able to upload files to me using the web, i am thinking of
> putting a button or someting and have a perl program connected to it
> that would fetch the local file and upload it to my server, but will it
> be local to the client who is uploading the file or local to the
If you are using CGI.pm (as recommended by 9 out of 10 of Perl Breeders )
then in the fine documentation you will find a section entitled:
CREATING A FILE UPLOAD FIELD
This should give you all of the information you will need. There is also
an article at <http://www.webreview.com> by Brent Michalski that goes into
a bit more detail.
You might also want to look at the CGI FAQ :
<http://www.webthing.com/tutorials/cgifaq.html>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 5 Jun 1999 16:28:10 +0100
From: "Thurley" <thurley@globalnet.co.uk>
Subject: Issuing remote commands without Telnet...
Message-Id: <7jbfrl$5p3$1@gxsn.com>
I need to issue commands on my ISPs servers to "make" Perl modules etc. The
problem is that they don't support Telnet.
Is there any way around this? Can I make the modules without Telnet?
Cheers,
James.
------------------------------
Date: Sat, 5 Jun 99 13:01:09 GMT
From: "Euro Jake" <jde222RemovethiS@iname.com>
Subject: Re: Newbie - would appreciate a hand to get started - Thanks in advance (-ej-)
Message-Id: <7jb6p6$kbh$1@news3.Belgium.EU.net>
On 2-Jun-1999, moseley@best.com (Bill Moseley) wrote:
> > I would like to get this working to get me started:
> > A simple .html file, which i start with ie5 browser, calling a simple .pl file,
> > which produces just a print "hello" and passes control back to the .html thing
> > Once this runs, i think i would be able to build on it further
>
> Do you have a web server running on your PC?
>
> No? There are a lot of options. Try www.apache.org for one.
Thanks for response Bill
Meantime Michiel advised me to have a little server "tinyweb"
ISP uses solaris server, so cant benefit from apache special capabilies
and the final purpose is to use perl on home site at providers server
The tinywebserver lets me access my pseudo home site as layed down on my local disk,
locally, unconnected to the net, and from outside when connected
Im still missing the link from activeperl to web browser output
When accessing a .pl file, perl runs it, gives the output to a dos screen that closes..
When running perl from dos prompt runs the script, the HTML code thats been built is on screen...
how do i tell the engine its supposed to feed my browser...
Ive tried search around but glueless where the link is missing
Thanks again for ur help
--
Euro Jake
>RemovethiS< in next line...
Anti spam email jde222RemovethiS@iname.com
------------------------------
Date: Sat, 5 Jun 99 13:06:22 GMT
From: "Euro Jake" <jde222RemovethiS@iname.com>
Subject: Re: Newbie - would appreciate a hand to get started - Thanks in advance (-ej-)
Message-Id: <7jb73j$kql$1@news3.Belgium.EU.net>
On 3-Jun-1999, Richard H <rhrh@hotmail.com> wrote:
> activeperl will let you develop and test scripts and their output from a
> DOS prompt, but you'll need a webserver to view their output in a
> browser, you can get a fair bit of development done without one, but
> youll need it sooner or later
>
> Richard H
Thank u Richard,
Ive been busy on this a bit, got progress, but still missing a few things
Please look my responses to Bill in this thread
Thanks again
--
Euro Jake
>RemovethiS< in next line...
Anti spam email jde222RemovethiS@iname.com
------------------------------
Date: Sat, 5 Jun 99 13:21:24 GMT
From: "Euro Jake" <jde222RemovethiS@iname.com>
Subject: Re: Newbie - would appreciate a hand to get started - Thanks in advance (-ej-)
Message-Id: <7jb7va$lii$1@news3.Belgium.EU.net>
On 3-Jun-1999, Michiel Verhoef <michiel.verhoef@wkap.nl> wrote:
> Look around for "tinyweb" (www.tucows.com), it's a small tsr that enables you to
> develop and run CGI on your win95 machine without need of a real server. And
> it's free :-)
>
> HTH,
>
> Michiel
Hi Michiel,
Thank u very much for this useful information
I downloaded installed and played around a bit...
Really a discovery for a first hands on server things...:))
I still have some open questions...
Would u please look the answer to Bill in this same thread...
Thank u very much
Dank je wel voor je adequate hulp, was zeer welkom..
misschien kan ik later nog op je assistance rekenen...
Mag ik even 'stout' zijn...:)))
Kan ik je mailen of heb je icq? dat gaat sneller...
Of liever niet...
Toch bedankt..
--
Euro Jake
>RemovethiS< in next line...
Anti spam email jde222RemovethiS@iname.com
------------------------------
Date: 5 Jun 1999 15:06:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Newbie - would appreciate a hand to get started - Thanks in advance (-ej-)
Message-Id: <7jbeda$4g4$1@gellyfish.btinternet.com>
On Sat, 5 Jun 99 13:01:09 GMT Euro Jake wrote:
>
> Im still missing the link from activeperl to web browser output
> When accessing a .pl file, perl runs it, gives the output to a dos screen that closes..
> When running perl from dos prompt runs the script, the HTML code thats been built is on screen...
> how do i tell the engine its supposed to feed my browser...
> Ive tried search around but glueless where the link is missing
> Thanks again for ur help
>
Please can you arrange for your newsreader to emit line of a socially
respectable 72 or so characters.
If you have installed Activeperl on your PC then the documentation
should be installed as HTML accessible through a link on your Start Menu,
in this documentation there is a particular document that describes how
to make various HTTP servers work with Perl CGI programs. If the HTTP
server you are using is not in there or there are things then you do
not understand then you should probably ask in the newsgroup
comp.infosystems.www.servers.ms-windows
as there is nothing Perl specific about this.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 05 Jun 1999 12:51:57 GMT
From: cmeli@cis.um.edu.mt
Subject: perl script to munge
Message-Id: <37591d2b.8838399@news.newsguy.com>
Is there any ready-made perl script to munge all or particular
emails within a text file (e.g. a mailing list digest which is going to
be automatically posted to usenet) ?
Regards,
Clyde
------------------------------
Date: Sat, 5 Jun 1999 05:12:34 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: problem clearing an array of array
Message-Id: <2mpaj7.dvk.ln@magna.metronet.com>
smnayeem@my-deja.com wrote:
: for ($i = 0, $i <= $#$MyArray, $i++) {
s/,/;/g; # you should give 3 statements to for()
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 Jun 1999 10:27:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: replacing a word in a flat file
Message-Id: <slrn7ligru.k0l.abigail@alexandra.delanet.com>
Samir Jain (sjain@uswest.com) wrote on MMCIII September MCMXCIII in
<URL:news:37583210.36E0C1E6@uswest.com>:
`` Hi,
`` This is my first program and i am stuck.. I have a flat file which
`` looks like this
``
`` usr1:passwd1
`` usr2:passwd2
`` usr3:passwd3
``
`` I want to replace passwd1 with passwdx.
perl -i -wpe 's/passwd1/passwdx/' file
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 5 Jun 1999 13:34:42 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: sendmail doesn't work
Message-Id: <7jb91i$44b$1@gellyfish.btinternet.com>
On 05 Jun 1999 04:08:42 GMT DarStec wrote:
> In article <375616E1.E5C2BFD1@chatbase.com>, TRG Software : Tim Greer
> <webmaster@chatbase.com> writes:
>>
>>Free web server offering CGI... And you bring those troubles here? :-)
>>
>
> Let me get this right. Those that can't afford $100 or more a month for a
> "real" web host are not suppose to learn Perl, and should be excluded from
> asking questions and learning in this newsgroup?
>
Leaving aside the fact that the sentence was followed by :-) which should
indicate to the reader the spirit in which it should be taken - I dont
see anywhere in that sentence where what you are saying is suggested.
I think however that this group is not the appropriate place to be
asking questions about running Perl programs on a particular server, I would
hope that those services have helpdesks for things like that - and if they
dont then you should be considering whether you are really getting value
for money (yes even for free) from that service.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 5 Jun 1999 15:08:27 +0100
From: "James Verrill" <james.verrill@cwcom.net>
Subject: simple sendmail question
Message-Id: <37592ed7.0@news1.mcmail.com>
Using sendmail is it possinle to send a file as an attachment?
If so, how?
Thanks in advance
James
------------------------------
Date: Sat, 05 Jun 1999 15:52:55 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: simple sendmail question
Message-Id: <7jbfbh$1am$2@fir.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
"James Verrill" <james.verrill@cwcom.net> wrote:
>Using sendmail is it possinle to send a file as an attachment?
>If so, how?
You accidentally sent this to a perl newsgroup instead of a mail one.
------------------------------
Date: Sat, 05 Jun 1999 13:16:21 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: The artistic license and perl:
Message-Id: <pudge-0506990916270001@192.168.0.77>
In article <ylvhd393wi.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:
# It's probably pointless arguing with you about any license, then, since
# you don't seem to be willing to accept the reality of how they're used.
Well, part of my point is that you won't provide any specific examples of
how they are used, or how they could be used for Bad.
# The people interpreting them will be lawyers. Judges are lawyers. If
# it's not clear to a lawyer, what will be *enforced* should it ever come to
# court is what the lawyers think of it.
Right, and my point is that it probably doesn't matter. I might concede
it matters if you provide an example of how it could be used for Bad.
Until then, I cannot see how it would be used for Bad, so your warnings
really don't mean much.
# you'll notice that the other software licenses explicitly include the use
# of the item, so there's other work in the field that sets a precendent for
# treating them as separate things.
But unless there's precedent for them being necessarily treated as
separate things, I'm not sure I will accept that this is a problem.
# >> | 5. You may charge a reasonable copying fee for any distribution of this
# >> | Package. You may charge any fee you choose for support of this Package.
# >> | You may not charge a fee for this Package itself. However, you may
# >> | distribute this Package in aggregate with other (possibly commercial)
# >> | programs as part of a larger (possibly commercial) software distribution
# >> | provided that you do not advertise this Package as a product of your
# >> | own. You may embed this Package's interpreter within an executable of
# >> | yours (by linking); this shall be construed as a mere form of
# >> | aggregation, provided that the complete Standard Version of the
# >> | interpreter is so embedded.
#
# >> So you write some trivial little wrapper around the Perl interpretor
# >> that changes a command-line option or something, and then distribute it
# >> as proprietary software.
#
# > Sure. Go for it. Why is this Bad? You can't call it perl, so I don't
# > care.
#
# Of course you can call it Perl. Where in point 5 does it say you can't
# call it Perl?
Where it says that you cannot advertise this Package as a product of your
own. If you make it proprietary, and still call it Perl, you are
therefore claiming Perl to be "a product of your own". I don't see any
way around that.
Again, I am not opposed to thinking that any of the above are problems,
but for the life of me I cannot think how they can damage Perl, perl, or
the Perl community. If I had some examples, I might be inclined to agree
with you.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Sat, 05 Jun 1999 13:38:34 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Using Perl Modules
Message-Id: <7jb7fl$ir4$3@fir.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
"Thurley" <thurley@globalnet.co.uk> wrote:
>I need to use one of these perl module things, but I have a few proplems:
>I am running Windows, do I cannot (as far as I know) use these "make"
>commands to compile the module. I will need to use them on a Unix web
>server, so I guess I should compile them there - but how? Can I do it in
>CuteFTP or something? Do I even need to compile it? Where do I put it?
>
>As you can see, I haven't got a clue what I'm talking about.
>
>The module in question is LWP::Simple.
Worry about installing modules at a later date. The LWP modules are part
of the standard perl installation and if you have a current version of
perl installed, you also have LWP::Simple.
Try entering:
perldoc LWP::Simple
If you see the docs for it, you should have it.
Good luck,
------------------------------
Date: 05 Jun 1999 07:40:33 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Using Perl Modules
Message-Id: <m3bteuvk8e.fsf@moiraine.dimensional.com>
sowmaster@juicepigs.com (Bob Trieger) writes:
> Worry about installing modules at a later date. The LWP modules are part
> of the standard perl installation and if you have a current version of
> perl installed, you also have LWP::Simple.
LWP is not part of the standard distribution. It probably
should be, but is dependent upon far too many other things
to be added.
I believe that it may be included in the windows only
distribution published by activestate, though.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Sat, 05 Jun 1999 14:41:56 GMT
From: cybear_x-nospam@geocities.com (Cybernetic Bear)
Subject: whats wrong with this script?
Message-Id: <375935b5.72289229@news.istar.ca>
I am trying to limit access to a script by IP address. My gameplan is
to compare the IP of the user to a hosts.allow file. if it matches,
the rest of the script runs, if it doesn't match, a die() gets called
and the script ends.
my code to check the IP is:
$iphost= $ENV{'REMOTE_ADDR'}; #read in IP address of remote host
open (HOSTFILE, "<$docroot./hosts.allow");#read in hosts.allow file
@ipallow=<HOSTFILE>;
close (HOSTFILE);
$deny=1;
print "$iphost";
foreach $ip (@ipallow){ #compare host IP with hosts.allow
if ($iphost == $ip) {$deny=0;}
print "$iphost $ip $deny<br>";
}
print $deny;
if ($deny == 1){print ("We will kill script");}
else {print"allow script: $iphost";}
Note: the print statements are for troubleshooting purposes.
my hosts.allow file basically looks like:
192.168.0.1
192.169.0.5
etc...
when the script runs, the output of the IPs suggest that both the
users IP and one of the hosts.allow IP's are the same, but the if()
that compares them seems to fail to see it. I'm sure I'm missing
something simple.
Your help/comments please.
Dave
------------------------------
Date: Sat, 05 Jun 1999 11:12:03 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: whats wrong with this script?
Message-Id: <37593df4.0@usenet.fccj.cc.fl.us>
In article <375935b5.72289229@news.istar.ca>, cybear_x-nospam@geocities.com
(Cybernetic Bear) wrote:
> I am trying to limit access to a script by IP address. My gameplan is
> to compare the IP of the user to a hosts.allow file. if it matches,
> the rest of the script runs, if it doesn't match, a die() gets called
> and the script ends.
>
How do you account for those behind Proxy and/or NAT/IPMasqurading?
> my code to check the IP is:
> $iphost= $ENV{'REMOTE_ADDR'}; #read in IP address of remote host
> open (HOSTFILE, "<$docroot./hosts.allow");#read in hosts.allow file
Didn't check for failure - lookup $!
> print "$iphost $ip $deny<br>";
If this is a CGI, you should lookup correct CGI.pm usage...
I think you have a logic error...
HTH,
-Sneex- :]
__________________________________________________________________
Bill Jones | FCCJ DSS | Life is a 'Do it yourself' thing...
http://www.fccj.org/cgi/mail?dss
Jacksonville Perl Mongers
http://jacksonville.pm.org
jax@jacksonville.pm.org
'Be not the first by whom the new are tried,
nor yet the last to lay the old aside...'
------------------------------
Date: Sat, 05 Jun 1999 15:17:33 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: whats wrong with this script?
Message-Id: <7jbf0n$90r$1@xenon.inbe.net>
In article <375935b5.72289229@news.istar.ca>, cybear_x-nospam@geocities.com (Cybernetic Bear) wrote:
>I am trying to limit access to a script by IP address. My gameplan is
>to compare the IP of the user to a hosts.allow file. if it matches,
>the rest of the script runs, if it doesn't match, a die() gets called
>and the script ends.
[snip]
> if ($iphost == $ip) {$deny=0;}
[snap]
>when the script runs, the output of the IPs suggest that both the
>users IP and one of the hosts.allow IP's are the same, but the if()
>that compares them seems to fail to see it. I'm sure I'm missing
>something simple.
Indeed :-)
Try 'eq' instead of '=='. After all, the different parts of an IP address
may be numeric, but the full IP address should be compared as
a string...
Michel.
------------------------------
Date: Sat, 05 Jun 1999 15:43:22 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: whats wrong with this script?
Message-Id: <7jbepl$1am$1@fir.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
cybear_x-nospam@geocities.com (Cybernetic Bear) wrote:
>I am trying to limit access to a script by IP address. My gameplan is
>to compare the IP of the user to a hosts.allow file. if it matches,
>the rest of the script runs, if it doesn't match, a die() gets called
>and the script ends.
>
>my code to check the IP is:
>$iphost= $ENV{'REMOTE_ADDR'}; #read in IP address of remote host
>open (HOSTFILE, "<$docroot./hosts.allow");#read in hosts.allow file
I bet if you were checking the status of your open that a major problem
in this program would stick out like a sore thumb.
------------------------------
Date: Sat, 05 Jun 1999 15:33:48 GMT
From: cybear_x-nospam@geocities.com (Cybernetic Bear)
Subject: Re: whats wrong with this script?
Message-Id: <3759428e.75579089@news.istar.ca>
I don't need to account for anyone behind a proxy as I am limiting the
script to only a few IP's on the same C class as the server that is
running the script.
if $iphost = 192.168.0.1 and $ip = 192.168.0.1
then shouldn't $iphost==$ip be true?
and following that logic, it shouldn't matter where I get the ip
values from, as long as they match, the above should work, but it
doesn't appear to.
Dave
On Sat, 05 Jun 1999 11:12:03 -0400, "Bill Jones" <bill@fccj.org>
wrote:
>In article <375935b5.72289229@news.istar.ca>, cybear_x-nospam@geocities.com
>(Cybernetic Bear) wrote:
>
>
>> I am trying to limit access to a script by IP address. My gameplan is
>> to compare the IP of the user to a hosts.allow file. if it matches,
>> the rest of the script runs, if it doesn't match, a die() gets called
>> and the script ends.
>>
>
>How do you account for those behind Proxy and/or NAT/IPMasqurading?
>
>
>> my code to check the IP is:
>> $iphost= $ENV{'REMOTE_ADDR'}; #read in IP address of remote host
>> open (HOSTFILE, "<$docroot./hosts.allow");#read in hosts.allow file
>
>Didn't check for failure - lookup $!
>
>> print "$iphost $ip $deny<br>";
>
>If this is a CGI, you should lookup correct CGI.pm usage...
>
>I think you have a logic error...
>
>HTH,
>-Sneex- :]
>__________________________________________________________________
>Bill Jones | FCCJ DSS | Life is a 'Do it yourself' thing...
> http://www.fccj.org/cgi/mail?dss
>
> Jacksonville Perl Mongers
> http://jacksonville.pm.org
> jax@jacksonville.pm.org
>
> 'Be not the first by whom the new are tried,
> nor yet the last to lay the old aside...'
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5898
**************************************