[18768] in Perl-Users-Digest
Perl-Users Digest, Issue: 936 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 19 09:05:32 2001
Date: Sat, 19 May 2001 06:05:09 -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: <990277509-v10-i936@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 19 May 2001 Volume: 10 Number: 936
Today's topics:
Re: best way to evaluate $1 so it's not read-only? (M.J.T. Guy)
Re: best way to evaluate $1 so it's not read-only? (Kai Henningsen)
Re: Can anyone help me please? <boqichi0@earthlink.net>
Re: good perl... <leapius@hotmail.com>
Re: good perl... <carlos@plant.student.utwente.nl>
Re: Handling JPEGs without modules <ubl@schaffhausen.de>
Re: Hash: keys to variable names, or variable names to <boqichi0@earthlink.net>
Re: Help: using constants from inherited parent class <michael@stroeck.com>
Re: HTTP Response suppression (David Efflandt)
Re: internalServerErrorNote ? <boqichi0@earthlink.net>
Re: internalServerErrorNote ? <ubl@schaffhausen.de>
Is this ok? <jon@officedevil.com>
Is this ok? <jon@officedevil.com>
Re: Is this ok? <keesh@users.pleaseremovethisbit.sourceforge.net>
Re: Is this ok? <jon@officedevil.com>
Re: login script <boqichi0@earthlink.net>
Re: modem/serialport experts? <cyberman@physics.upatras.gr>
oh c'mon please, one of you perl/unix gurus!!! <boqichi0@earthlink.net>
Re: Script help <boqichi0@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 May 2001 10:18:59 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: best way to evaluate $1 so it's not read-only?
Message-Id: <9e5haj$hse$1@pegasus.csx.cam.ac.uk>
Abigail <abigail@foad.org> wrote:
>
>But before you are going to profile any code, you should first analyze
>your algorithm, and see whether you are better off using a faster
>algorithm. One can profile and micro-optimize the hell out of bubblesort,
>a non-profiled, not micro-optimized heapsort is going to beat the crap
>out of it.
That depends on how many objects you're planning to sort. If I need
to sort a billion sets of six objects each, micro-optimised bubblesort
will be a winner.
But I agree that in the general case such micro-optimisation is
misguided.
Mike Guy
------------------------------
Date: 19 May 2001 13:00:00 +0200
From: kaih=81842UO1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: best way to evaluate $1 so it's not read-only?
Message-Id: <81842UO1w-B@khms.westfalen.de>
abigail@foad.org (Abigail) wrote on 19.05.01 in <slrn9gcfpg.sk5.abigail@tsathoggua.rlyeh.net>:
> Benjamin Goldberg (goldbb2@earthlink.net) wrote on MMDCCCXVIII September
> MCMXCIII in <URL:news:3B05FCD4.79F0CAC2@earthlink.net>:
> ** xris wrote:
> ** >
> ** > In article <u78iets4b8e0rb90bcesatjoprc71sd8h2@4ax.com>,
> ** > Bart Lateur <bart.lateur@skynet.be> wrote:
> ** >
> ** > > This is called micro-optimization. It'll only save you unmeasurable
> ** > > fractions of percents of execution time. I wouldn't even bother.
> ** > > It's not worth it.
> ** >
> ** > maybe. but that's just how I am.
> **
> ** Whether you do micro-optomization or not is up to you, but what you
> ** really should do first, before doing it, is to profile your code, and
> ** see where the bottlenecks are, and optomize that, first. *Then* do
> ** whatever micro-optomizations you want.
>
>
> But before you are going to profile any code, you should first analyze
> your algorithm, and see whether you are better off using a faster
> algorithm.
Why would you want that, unless the profile tells you there's a problem at
that place?
>One can profile and micro-optimize the hell out of bubblesort,
> a non-profiled, not micro-optimized heapsort is going to beat the crap
> out of it.
Well, assuming data size and constant factor do not mean that you never
see the advantage. If your problem is small enough, a bubblesort *might*
be better.
And then there's the bidirectional bubblesort ...
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Sat, 19 May 2001 10:40:18 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: Re: Can anyone help me please?
Message-Id: <3B06796C.F49DBE3E@earthlink.net>
huh?
if you want help, you gotta explain what the f**k yer talkin about
Robb Meade wrote:
> Hi all,
>
> I'm having real problems with my mailing list script here, I just dont know
> whats causing the problem...
>
> I've also noticed now that sometimes the ?site=mysitename doesnt seem to get
> used properly by the script, as it doesnt return the value...
>
> Can anyone offer some help please?
>
> --
>
> Robb Meade
>
> Kingswood Web Services
> www.kingswoodweb.net
------------------------------
Date: Sat, 19 May 2001 11:14:47 +0100
From: "Leo" <leapius@hotmail.com>
Subject: Re: good perl...
Message-Id: <9e5h18$dfl$1@uranium.btinternet.com>
Well the two books which you'll (and I) ever need are "Programming Perl"
(The camel) and "Perl Cookbook" - both from O'Reilly. These two books will
cover pretty much every aspect of perl. The former is the so called "bible"
for perl and covers every aspect of the language, the latter is a "cookbook"
which has a number of worked recipies to a load of typical tasks that you
will need to perform at some point when programming.
cheers,
Leo
"Brent Ulfig" <bulfig@bargainisp.net> wrote in message
news:wqoN6.79$ce.370666@newsrump.sjc.telocity.net...
> I'm looking for a good book for learning perl. I need to write some
scripts
> for a linux server we have here.
>
> Thanks,
>
> Brent Ulfig
> Senior Network Engineer
> Bargain ISP
> bulfig@bargainisp.net
>
> "Home of the $10/month unlimited internet access...nationwide."
>
>
------------------------------
Date: Sat, 19 May 2001 13:02:55 +0200
From: "carlos" <carlos@plant.student.utwente.nl>
Subject: Re: good perl...
Message-Id: <9e5jlb$5fg$1@dinkel.civ.utwente.nl>
`perldoc -q book`
"Brent Ulfig" <bulfig@bargainisp.net> wrote in message
news:wqoN6.79$ce.370666@newsrump.sjc.telocity.net...
> I'm looking for a good book for learning perl. I need to write some
scripts
> for a linux server we have here.
>
> Thanks,
>
> Brent Ulfig
> Senior Network Engineer
> Bargain ISP
> bulfig@bargainisp.net
>
> "Home of the $10/month unlimited internet access...nationwide."
>
>
------------------------------
Date: Sat, 19 May 2001 13:43:48 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Handling JPEGs without modules
Message-Id: <3B066A83.B8EEC473@schaffhausen.de>
"Michael A. Krehan" schrieb:
> So... once again. Is there a pure-perl JPEG processor available somewhere?!
> I have not been able to find anything.
I once had one in my signature.... uhm, no I dont think there is one, although
its probably possihble to write one.
->malte
------------------------------
Date: Sat, 19 May 2001 11:16:51 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: Re: Hash: keys to variable names, or variable names to keys?
Message-Id: <3B0681FC.328CACB3@earthlink.net>
how about something like (untested, unfinished)
for(keys %config_length)
{
if(length $_ > $config_length{$_})
{
print "You exceeded the length of $_, we only allow $config_length{$_}
characters.";
}
}
then just make a hash where the key is the name of the html field and the value is the
length...yeah, you had ithe right idea!!
Paul Johnson wrote:
> I wrote a CGI script that processes a bunch of string variables and saves
> them into a dataset. I find my self doing the same repetitive, stupid
> things, one variable after another. I wonder why can't I find a way to
> make a hash of variable names and then just iterate over the hash?
>
> I am no perl veteran, as you may guess. So I'm not ashamed to share with
> you my ignorance. Here's a subroutine that checks the lengths of the
> variables that have been inputted. Earlier, the script has already read
> the values out of the CGI input with declarations like
>
> $lastname = $cgi_input->param('lastname');
>
> Please excuse my mixture of HTML shortcuts from cgi and the actual HTML.
> I've not been able to make the transition all the way...
>
> sub validateLengths {
>
> if (
> 30 < (my $lastnameLength = length("$lastname")) ||
>
> 20 < (my $firstnameLength = length("$firstname")) ||
> 20 < (my $middleLength = length("$middle")) ||
> 25 < (my $addr1Length = length("$addr1")) ||
> 25 < (my $addr2Length = length("$addr1")) ||
> 25 < (my $cityLength = length("$city")) ||
> 15 < (my $stateLength = length("$state")) ||
> 11 < (my $zipLength = length("$zip")) ||
> 25 < (my $countryLength = length("$country")) ||
> 40 < (my $emailLength = length("$email")) ||
> 25 < (my $otherFieldLength = length("$otherField")) ||
> 256 < (my $careerLength = length("$career")) ||
> 256 < (my $usePolsLength = length("$usePols")) ||
> 256 < (my $profStoryLength = length("$profStory")) ||
> 20 < (my $passwordLength = length("$password")) )
> {
>
> print "The Length of my lastNameLength $lastnameLength <P>";
>
> print " <HTML> ";
>
> print $cgi_input->h1('Sorry');
> print $cgi_input->h1({-align=>'center'},'You exceeded the length
> limit for one or more variables');
> print "<p>";
> print "Here are the particulars:<p><p>";
> if ($lastnameLength > 30) {
> print qq[Your entry for last name is too long.
> We allowed 30 characters, but your name took $lastnameLength.
> Sorry, can you give us something shorter <p>];
> }
>
> if ($firstnameLength > 20) {
> print qq[Your first name entry is too long.
> We allowed 20 characters, but your input took $firstnameLength.
> Sorry, can you find an alias or abbreviate somehow?<p>] ;
> }
>
> if ($middleLength > 20 ) {
> print qq[Your middle name entry is too long.
> We allowed 20 characters, but your input took $middleLength.
> Sorry, can you find an alias or abbreviate somehow?<p>] ;
> }
>
> if ($addr1Length > 25 ) {print qq[Your first address line entry is too long.
> We allowed 25 characters, but your input took $addr1Length.
> Sorry, can you abbreviate somehow?<p>];
> }
>
> if ($addr2Length > 25 ) {
> print qq[Your second address line entry is too long.
> We allowed 25 characters, but your input took $addr2Length.
> Sorry, can you abbreviate somehow?<p>];
> }
>
> if ($cityLength > 25 ) { print qq[Your city entry is too long.
> We allowed 25 characters, but your input took $cityLength.
> Sorry, can you abbreviate somehow?<p>];
> }
>
> if ($stateLength > 15 ) { print qq[Your state entry is too long.
> We allowed 15 characters, but your input took $stateLength.
> Sorry, can you abbreviate somehow?<p>];
> }
> if ($zipLength > 11 ) { print qq[Your zip entry is too long.
> We allowed 15 characters, but your input took $zipLength.
> Sorry, can you abbreviate somehow?<p>] ;
> }
> if ($countryLength > 25 ) {
> print qq[Your country entry is too long.
> We allowed 25 characters, but your input took $countryLength.
> Sorry, can you abbreviate somehow?<p>];
> }
> if ($emailLength > 40 ) {
> print qq[Your email entry is too long.
> We allowed 40 characters, but your input took $emailLength.
> Sorry, can you abbreviate somehow?<p>];
> }
>
> if ($otherFieldLength > 25 ){
> print qq[Your other field entry is too long.
> We allowed 25 characters, but your input took $otherFieldLength.
> Sorry, can you abbreviate somehow?<p>] ;
> }
>
> if ($careerLength > 256 ){
> print qq[Your description of your career is too long.
> We allowed 256 characters, but your input took $careerLength.
> Sorry, can you abbreviate somehow?<p>] ;
> }
> if ($usePolsLength > 256 ) {
> print qq[Your description of your use of politics is too long.
> We allowed 256 characters, but your input
> took $usePolsLength. Sorry, can you abbreviate somehow?<p>] ;
> }
>
> if ($profStoryLength > 256 ) {
> print qq[Your professor story is too long.
> We allowed 256 characters, but your input took $profStoryLength.
> Sorry, can you abbreviate somehow?<p>] ;
> }
>
> print q[<p><p>];
> print q[Hit the browser back button and make those babies fit!<p>];
>
> print " </HTML> ";
> return 1;
> }
> else {
> return 0;
> }
> }
>
> My idea is that I could create a hash using the variables as keys and the
> contents would be arrays, say holding the maximum length allowed and the
> observed length, and then I could iterate. I need to be able to take the
> keys and use them both as variable names like $lastname as well as
> convert them to strings like "lastname" for printing out.
>
> Am I just looking for a too-easy/simple minded approach?
>
> All the examples of hashes I find have keys that are strings or such, not
> variable names.
>
> And I can't understand the writeup I get from this
> perldoc -q "How can I use a variable as a variable name?"
>
> If you have advice, I'm listening.
>
> Well, so long, and thanks for all the Perl.
>
> PJ
> http://lark.cc.ukans.edu/~pauljohn
------------------------------
Date: Sat, 19 May 2001 14:27:22 +0200
From: "Michael Ströck" <michael@stroeck.com>
Subject: Re: Help: using constants from inherited parent class
Message-Id: <3b06667c$1@e-post.inode.at>
"Abigail" <abigail@foad.org> schrieb im Newsbeitrag
news:slrn9gbe3f.anl.abigail@tsathoggua.rlyeh.net...
> Ren Maddox (ren@tivoli.com) wrote on MMDCCCXVII September MCMXCIII in
> <URL:news:m37kzefd9f.fsf@dhcp9-172.support.tivoli.com>:
> ][ On Fri, 18 May 2001, rstands@hotmail.com wrote:
> ][
> ][ > This must be fairly common but I can't find an example in my
> ][ > ActiveState installation nor any reference to it in AS's docs, Camel
> ][ > or Conway's OOP. I am sub-classing a package. The parent(SUPER)
> ][ > package allows exporting some constants e.g.:
> ][
> ][ It may not be that common as exporting symbols is not very OO.
>
> I've never understood why. I've always learned that use of constants
> was a good thing, and that duplication of data should be avoided.
>
>
> Doesn't the school of OO agree?
<snip>
I agree with Abigail. Can someone point out some disadvantages to that ?
And don't say "It's not OOP" ;-)
Michael Ströck
------------------------------
Date: Sat, 19 May 2001 12:27:21 +0000 (UTC)
From: see-sig@from.invalid (David Efflandt)
Subject: Re: HTTP Response suppression
Message-Id: <slrn9gcpl8.hqd.see-sig@typhoon.xnet.com>
On Fri, 18 May 2001 21:29:07 -0700, Elmer Fudd <elmer_fudd@yahoo.com> wrote:
> How do I suppress the returned HTTP Response from an exec cgi call?
>
> I have searched every FAQ I could find, and various attempts with Yahoo.
> Although there is a waelth of info on headers, I could not find suppression.
You will not find it in a Perl faq because it is NOT a Perl specific
question. If you don't want something, remove it. HTTP headers end at
the first blank line:
# Assuming CGI response is in @reply list:
while ($_ = shift @reply) { last if /^\s$/; }
> The script itself is very very basic/minor. I do get the expected/requested
> data back from the script, it's just accompanied with a std HTTP Response.
> That response gets embedded into my HTML page along with the data and
> renders visibly to my visitors.
>
> tia
> Brian.
--
David Efflandt (Reply-To is valid) http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Sat, 19 May 2001 10:26:57 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: Re: internalServerErrorNote ?
Message-Id: <3B067640.70A2E0B2@earthlink.net>
gotta print out the header for one, incase any error prints something to
browser:
#!/usr/bin/perl -w
BEGIN{
print "Content-type: text/html\n\n";
}
and if you have perl5 and the CGI modules, try
use CGI::Carp q{fatalsToBrowser};
right after the #! line, it should also pass on any errors to the browser to
help you debug...
David Soming wrote:
> I call this script from my browser and get internalServerErrorNote (I dont
> have access to logs).
> However, it does create and write to the file but why the error? -I'm
> certain this is correct including permissions/path/transfer mode. even
> with -w omitted.
> No error or warnings from program from the command line under windows.
>
> #!/usr/bin/perl -w
>
> if (open(LOGFILE, ">>message.log")) {
> print LOGFILE ("this is test number 1.\n");
> print LOGFILE ("this is test number 2.\n");
> close (LOGFILE);
> }
------------------------------
Date: Sat, 19 May 2001 13:49:02 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: internalServerErrorNote ?
Message-Id: <3B066BBE.13B11947@schaffhausen.de>
Franco Luissi schrieb:
>
> gotta print out the header for one, incase any error prints something to
> browser:
>
> #!/usr/bin/perl -w
> BEGIN{
> print "Content-type: text/html\n\n";
> }
>
> and if you have perl5 and the CGI modules, try
>
> use CGI::Carp q{fatalsToBrowser};
and if you want to catsh all errors related to Perl (not for example
wron permmissions)
you can always eval your code. And print out $@ in case something wrent
terribly wrong.
->malte
------------------------------
Date: Sat, 19 May 2001 11:25:01 +0100
From: "Jon" <jon@officedevil.com>
Subject: Is this ok?
Message-Id: <lSrN6.84561$PP3.6255280@nnrp3.clara.net>
Hi,
I am writting my own login script for a web based interface for my customers
to use to control there account. Current this is how it works, and I would
like to know if you think it secure/good...
- Customer enters there username/password into web form, checked though sql
database
- If the password is ok, then the script generates a 20 charactures long
string made of random numbers/letters, this is the session id which is
vailded for 2 hours. This session id is recorded in a file on the server,
along with the username. Then I use the crypt method to make a crypted
version of there password using the session id as the salt. This crypted
version is put into a cookie on there pc which is set it die ones they close
the browser.
Everytime they use a feature in the control panel, the script is called
using the 20 characture session id in the query area of the url. When the
script runs, it grabs the session id from the url, checks it in the file on
the server (and therefore if found in the file the session id is vaild) then
the script opens the cookie on there pc, and checks the crypted version of
the password/session id is vaild.
If so, they are logged in.
Do you think this method is good? Suggestions or ideas would be great.
Thanks, and sorry if this is not the right area,
Jon
------------------------------
Date: Sat, 19 May 2001 11:25:21 +0100
From: "Jon" <jon@officedevil.com>
Subject: Is this ok?
Message-Id: <mSrN6.84562$PP3.6255184@nnrp3.clara.net>
Hi,
I am writting my own login script for a web based interface for my customers
to use to control there account. Current this is how it works, and I would
like to know if you think it secure/good...
- Customer enters there username/password into web form, checked though sql
database
- If the password is ok, then the script generates a 20 charactures long
string made of random numbers/letters, this is the session id which is
vailded for 2 hours. This session id is recorded in a file on the server,
along with the username. Then I use the crypt method to make a crypted
version of there password using the session id as the salt. This crypted
version is put into a cookie on there pc which is set it die ones they close
the browser.
Everytime they use a feature in the control panel, the script is called
using the 20 characture session id in the query area of the url. When the
script runs, it grabs the session id from the url, checks it in the file on
the server (and therefore if found in the file the session id is vaild) then
the script opens the cookie on there pc, and checks the crypted version of
the password/session id is vaild.
If so, they are logged in.
Do you think this method is good? Suggestions or ideas would be great.
Thanks,
Jon
------------------------------
Date: Sat, 19 May 2001 13:22:11 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Is this ok?
Message-Id: <9e5od2$c62$1@newsg3.svr.pol.co.uk>
Jon,
> I am writting my own login script for a web based interface for my
> customers to use to control there account. Current this is how it
> works, and I would like to know if you think it secure/good...
Just how secure do you need? What you suggest is fine for moderate
security, but I wouldn't use it for sending any confidential information.
If you're selling, this isn't enough...
> - Customer enters there username/password into web form, checked though
> sql database
Username and password transmitted in plaintext. Dangerous.
> - If the password is ok, then the script generates a 20 charactures long
> string made of random numbers/letters, this is the session id which is
> vailded for 2 hours. This session id is recorded in a file on the
> server, along with the username. Then I use the crypt method to make a
> crypted version of there password using the session id as the salt.
> This crypted version is put into a cookie on there pc which is set it
> die ones they close the browser.
Surely an attacker could simply duplicate this cookie and feed it to your
script? Are you reseting the time limit every time a transaction is made,
or are you limiting logged in time to 2 hours? If the former, drop the
time down to 10 minutes or so.
> Everytime they use a feature in the control panel, the script is called
> using the 20 characture session id in the query area of the url. When
> the script runs, it grabs the session id from the url, checks it in the
> file on the server (and therefore if found in the file the session id is
> vaild) then the script opens the cookie on there pc, and checks the
> crypted version of the password/session id is vaild.
Again, transmitted in plaintext.
> Do you think this method is good? Suggestions or ideas would be great.
How about HTTPS (rfc2660 IIRC, http://www.ietf.org/rfc/rfc2660.txt
maybe?)? This gets around the plaintext transmission and is far more
secure. If you're running Apache, take a look at some of the SSL modules
available, they can save you a lot of work.
Regards,
Ciaran
--
Ciaran McCreesh
mail: keesh@users.sourceforge.net
web: http://www.opensourcepan.com/
------------------------------
Date: Sat, 19 May 2001 13:31:29 +0100
From: "Jon" <jon@officedevil.com>
Subject: Re: Is this ok?
Message-Id: <TItN6.6713$ML4.504759@nnrp4.clara.net>
> Just how secure do you need? What you suggest is fine for moderate
> security, but I wouldn't use it for sending any confidential information.
> If you're selling, this isn't enough...
This will be used as a login to a free web based email newsletter
management - like a listbot type service. Everything is based over my
secure server. So we are not talking about protecting credit card details
in the login area.
> Surely an attacker could simply duplicate this cookie and feed it to your
> script? Are you reseting the time limit every time a transaction is made,
> or are you limiting logged in time to 2 hours? If the former, drop the
> time down to 10 minutes or so.
Yeah of course, but the cookie is a cripted version of a 20 chacture string
which is made up from a random load of letters and numbers, in both upper
case and lower, so they would need to do some guessing first.
Thanks
Jon
> Jon,
>
> > I am writting my own login script for a web based interface for my
> > customers to use to control there account. Current this is how it
> > works, and I would like to know if you think it secure/good...
>
> Just how secure do you need? What you suggest is fine for moderate
> security, but I wouldn't use it for sending any confidential information.
> If you're selling, this isn't enough...
>
> > - Customer enters there username/password into web form, checked though
> > sql database
>
> Username and password transmitted in plaintext. Dangerous.
>
> > - If the password is ok, then the script generates a 20 charactures long
> > string made of random numbers/letters, this is the session id which is
> > vailded for 2 hours. This session id is recorded in a file on the
> > server, along with the username. Then I use the crypt method to make a
> > crypted version of there password using the session id as the salt.
> > This crypted version is put into a cookie on there pc which is set it
> > die ones they close the browser.
>
> Surely an attacker could simply duplicate this cookie and feed it to your
> script? Are you reseting the time limit every time a transaction is made,
> or are you limiting logged in time to 2 hours? If the former, drop the
> time down to 10 minutes or so.
>
> > Everytime they use a feature in the control panel, the script is called
> > using the 20 characture session id in the query area of the url. When
> > the script runs, it grabs the session id from the url, checks it in the
> > file on the server (and therefore if found in the file the session id is
> > vaild) then the script opens the cookie on there pc, and checks the
> > crypted version of the password/session id is vaild.
>
> Again, transmitted in plaintext.
>
> > Do you think this method is good? Suggestions or ideas would be great.
>
> How about HTTPS (rfc2660 IIRC, http://www.ietf.org/rfc/rfc2660.txt
> maybe?)? This gets around the plaintext transmission and is far more
> secure. If you're running Apache, take a look at some of the SSL modules
> available, they can save you a lot of work.
>
> Regards,
> Ciaran
>
> --
> Ciaran McCreesh
> mail: keesh@users.sourceforge.net
> web: http://www.opensourcepan.com/
------------------------------
Date: Sat, 19 May 2001 10:35:30 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: Re: login script
Message-Id: <3B067844.FAA6CF6C@earthlink.net>
what do you want from the CGI?
you may not need it if you are running on Apache, you may find the
.htaccess and .htpasswd file setup is all you need- but there are modules
if you need a script to interact with those files-
it depend what you want, search "htaccess" on CPAN, I know there is
Apache::HtAccess and Apache::HtPasswd as well as at least one other-
Ensure (not the loop tie one) , or some shit, that someone
recommended..dont know what that one does...or search the web for badly
written authentication scripts like extropia has to offer probably...
Wojciech Domalewski wrote:
> Hello:
>
> Does anyone knows if there's any perl cgi script that performs user
> authentication (Apache/.htaccess)?
>
> And what modules if any, to be compiled with apache, is required before
> this can be done?
>
> Thanks!
>
> Wojciech.Domalewski@pnti.waw.pl .
------------------------------
Date: Sat, 19 May 2001 14:50:13 +0300
From: "Manos Tsagias" <cyberman@physics.upatras.gr>
Subject: Re: modem/serialport experts?
Message-Id: <9e5mv3$4e4$1@usenet.otenet.gr>
Hash: SHA1
Hi Phil,
I am not a modem/serial expert, but I use the Device::SerialPort
v0.10 [in Linux Env].
probably, you need the $modem_obj->lookclear function, that clears
completly the buffers.
In addition to that, you may use the $modem_obj->matchclear, if your
match is the first character/word in the analyzing string.
Hope that helps,
sorry for my ugly english,
Manos
"Phil" <eclipsephil@aol.comnospam> wrote in message
news:20010518052559.29895.00000263@ng-bh1.aol.com...
> I am using mandrake linux a us robotics sportster voice 33.6 fax
> modem, perl 5.6.0 and device::SerialPort v.0.10
>
> I can initialise my call out and perform the first operation fine.
> However when I or the other end drop the line I seem to have
> problems with wierd characters in the buffer. ie if I do something
> like this simplified version (note I'm not worried about parameters
> just for this question)
>
> do {
>
> setup modem;
> write_modem;
> waitfor;
> down_line;
>
> } (while $running);
>
> I get characters like below (the =(n) is the ascii number of the
> char)
>
> NL = (10) e = (101) y = (255)
> or
> NUL = (0) " = (34) y = (255)
>
> Interestingly enough I am using 7 bit ascii so I should only be
> seeing characters upto ascii 127 as this is the highest number you
> can transmit in one 7bit byte. This leads me to beleive that the
> ascii 255 comes from the modem which I beleive represents the line
> going down. However I can trap that but I keep getting a few sets
> of several characters before I can get an empty buffer.
> The code I have used to down the line is below. My question is
> how can I reset the modem so when I start up again the buffers are
> completely clear.
>
> sub modem_write {
>
> my $string = shift;
>
> aborter ("write modem:no string to send") if (! (defined $string)
> );
>
> my $len_string = length($string);
> my $sent_bytes;
>
> eval { $sent_bytes=$modem_obj->write($string) };
>
> if ($@) {
> $dbg->$dbg_method ("write failed with $! ");
> return;
> } elsif (! (defined $sent_bytes) ) {
> $dbg->$dbg_method("send 0 bytes");
> return;
> } elsif ($sent_bytes != $len_string ) {
> $dbg->$dbg_method("send $sent_bytes but record is
>
> $len_string");
> return;
> }
>
> return 1;
>
> } # modem_write
>
> sub downline {
>
> $dbg->$dbg_method("Downline the phone");
>
> modem_write("$dle.$eot\r\n");
>
> modem_write("+++");
> sleep(3);
> modem_write('ATZ\r\n\n'); # note sure about this one
> sleep(3);
>
> $modem_status = 'Offline';
> eval { $modem_obj->close; };
> undef $modem_obj;
>
> } # end of downline
>
> Thanks in advance
> Phil
> Live the Journey!
For each destination is but a doorway to another!
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
iQA/AwUBOwZB1COZ30Ft1gGEEQIoSwCeK9qRnNUVw94fGl2XNvcd1omez2EAn0/w
yV2/6crzfBTq+bXlpzlJIGQW
=cVMh
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 19 May 2001 12:57:15 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: oh c'mon please, one of you perl/unix gurus!!!
Message-Id: <3B06997E.7E7A7C8E@earthlink.net>
I tried posting this a BSD group, i am having trouble using a newly
installed perl 5.6 ... not sure if its a configuration thing- its a
virtual server being hosted by someone- i have no tech support though -
just trying to track down the problem... here is what i posted to the
BSD list, no aswer from them...please please, any ideas...
perl hack has a BSD question:
Actually, its a bit of a cgi question, but i think its the config of a
BSD server that I need to fix.
A cgi script (don't worry its not the CGI thats causing the prob, been
writing CGIs for years) in perl is sitting in the cgi-bin of a BSD
server- a friend is using it for free (but its not a free server), so i
have no tech support but have some freedom- like almost unlimited space
it seems for storing and running things...but not root privilages or
anything like that, i mostly install things into ~username
dirs...anyway:
BSDI BSD/OS 3.1 Virtual Kernel #17:
is what it says when i login...
So my prob is this:
## background, dont worry its not a perl question##
I can run perl CGIs but they default (any perl run from command too,
actually defaults) to a perl4 (yikes) running somewhere normal like
/usr/bin/perl - to run perl5 i must say perl5 from the command line (and
have the #! line put the right location of course)... fine, but even
that perl is missing most of its modules, and since i have so much space
instead of just installing the modules (in my user directory) i'd rather
istall 5.6 ! So, I do and it runs fine from the command line but when I
put its address in the #! line it still runs from the command line but
*breaks* as a CGI - i think maybe from the command line its still
running the old perl5 regardless of the #! actually...it could be that
my installation of perl5.6 is broken but i just want to find out if that
is it, and anyway find out the following:
## end background ##
So! Questions:
1. how do I find out what web server I'm running? Its not Apache, and
"RPM" doesn't work (does that work on BSD anyway?)...
2. where might I find a config file or something else that is telling
the cgi-bin what perl to use etc [ also the files in @INC are all messed
up...but that doesn't matter much as I can add them, but the #! comes
first before anything and so must not break]...i looked and grepped
through all the .files in the home dir and the cgi-bin, made some
changes but none seemed to help (it was long enough ago that the server
must have been restarted since)
3. anything else that might help??
------------------------------
Date: Sat, 19 May 2001 10:59:44 GMT
From: Franco Luissi <boqichi0@earthlink.net>
Subject: Re: Script help
Message-Id: <3B067DF3.EE79EDB8@earthlink.net>
> open(SRC, "<$src") || die "Unable to open $src : $!\n";
> my @contents = <SRC>;
> close SRC;
>
> open (SRC, ">$src") || die "Unable to open $src : $!\n";
> foreach (@contents) {
>
> while(<SRC>)
> {
you put the contents of $src into @contents and then used <SRC> ... did you
try just using @contents ?
>
> my $Line = $_;
> #foreach $Pattern (@patterns)
> {
> if($Line =~ /UPD|TRSR|PRS/) {
> chomp $_;
> #if (m/UPD: /) {
> print DEST "$_\n";
> print "Found $_ and printed it to $dst\n";
> } else {
> print SRC "$_\n";
if you dont find what you're looking for you are still printing to the SRC
- writing over the old file...
>
> }
> }
> }
> }
> close SRC;
> close DEST;
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
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 V10 Issue 936
**************************************