[10082] in Perl-Users-Digest
Perl-Users Digest, Issue: 3675 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 10 02:07:21 1998
Date: Wed, 9 Sep 98 23:00:18 -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 Wed, 9 Sep 1998 Volume: 8 Number: 3675
Today's topics:
Re: Code to Check for acceptable file type <mgregory@asc.sps.mot.com>
graphs <"jdcaraway@mindspring.com"@mindspring.com>
Re: help requested on a perl program (Martien Verbruggen)
Re: Help: Problem with Pattern-Matching (David Adler)
Re: History of Perl - round 1 (Brand Hilton)
Re: History of Perl - round 1 (Ronald J Kimball)
Re: History of Perl - round 1 (David Adler)
How can I draw simple chart using perl? <peace1@writeme.com>
Inheritance <BrianS@CGGSoftwareDOTcom>
Re: IO::File Permissions - Enlightened! (Ronald J Kimball)
Re: local mail deliviry? <rra@stanford.edu>
Re: Opening in a windows 95 serial port with perl. (Bbirthisel)
Passing file handles (cs - Elton Kong)
Re: Perl "<!--#exec" with IIS, How? (Mike)
Re: Perl & Java - differences and uses (David Formosa)
Re: Perl & Java - differences and uses <pats@acm.org>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl Data Structures: trees etc... (David Formosa)
Re: Perl Data Structures: trees etc... <uri@sysarch.com>
Perl-Cgi-htaccess is this as simple as I think it is? <dmorel@stny.lrun.com>
Re: QUESTIONS (was: Perl Programmer Needed) (Patrick Timmins)
Re: Regular Expression - substitution from lower to upp (Ronald J Kimball)
Re: Script doesn't like text fields? (Tad McClellan)
SNMP examples <apollock@bit.net.au>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Sep 1998 08:19:11 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Code to Check for acceptable file type
Message-Id: <r84sug6gwo.fsf@asc.sps.mot.com>
abigail@fnx.com (Abigail) writes:
> Mike (mhanson@prtel.com) wrote on MDCCCXXXI September MCMXCIII in
> <URL: news:35F18BA1.6F00@prtel.com>:
> ++ @array = ("htm", "html", "shtml"); #array of acceptable file types.
> ++ $string = "index.htm"; #Yield acceptable
> ++ $string2 = "index2.shtml"; #Yield acceptable
> ++ $string3 = "pic.gif"; #yield unacceptable
> ++ How would you check to make sure the file extension in the string is an
> ++ acceptable file type that is stored in an array?
> ++ Thanks.
>
>
> { local $" = '|';
> $string =~ /\.(?:@{[map {quotemeta} @array]})$/o;
> }
Damn thats neat.
Why the (?: though?
------------------------------
Date: Wed, 09 Sep 1998 23:23:07 -0400
From: Daniel Caraway <"jdcaraway@mindspring.com"@mindspring.com>
Subject: graphs
Message-Id: <6t7hac$6r$1@camel21.mindspring.com>
Is it possible to create graphs using perl?
------------------------------
Date: Thu, 10 Sep 1998 02:48:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: help requested on a perl program
Message-Id: <r6HJ1.825$fA3.23811@nsw.nnrp.telstra.net>
In article <6t71bg$mit$1@nnrp1.dejanews.com>,
jojo9645@my-dejanews.com writes:
> Alright.
>
> the program is supposed to work on a field of data formatted as follow:
>
> data data | data data data |data | data data data | data |
>
> note: its a text file and each field has the usual "\n" at the end.
> The code which works fine on small files but not on big files is:
>
> #!/usr/bin/perl
> open(RF1,"raw.in");
> open(OF1,">trim.out");
Just for the record: you should always check the results of an open.
> $|=1;
> while($in=<RF1>){
You might want to use
while(defined($in=<RF1>)
-w would have warned you about this
> chop($in);
chomp is a newer and safer version of this.
> @field=split(/\|/,$in);
> foreach $m (@field){
> @a=split(/ /,$m);
> $wf="";
> foreach $n (@a){
> if ($n ne ""){
> $wf.=$n." ";
> }
> }
> $line.=$wf."|";
> }
> reset("a");
> reset("f");
> @a=split(/\|/,$line);
> foreach $m (@a){
> if ($m ne ""){
> $new.=$m."|";
> }
> }
> chop($new);
> chop($new);
> chop($new);
> chop($new);
> print OF1 "$new\n";
> print"$new\n";
> reset ("a-z");
> }
A split on /\s*\|\s*/ and joining back together with either '|' or ' | '
would do it as well. Or am I overlooking something? You might need to
make the pattern non-greedy.
And if you want to collapse all multiple spaces into a single one (not
just the ones around a |), you could even use a simple regexp. Come to
think of it, you can also use a regexp to collapse only multiple
spaces around a |.. Something like:
$in =~ s/\s+\|\s+/ | /g;
Of course, if you need to also deal with possible terminating | you
need to account for that.
But the question was why your program used up all the memory? It
doesn't for me on a Solaris box with perl 5.004_04. It does sort of
what it's supposed to do, except that it strips off too many
characters from the end, as specified with the four chops in your
code.
So, I can't answer why your code misbehaves on your platform. maybe
you have a bad perl installation?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd. | thing but mean your mother.
NSW, Australia |
------------------------------
Date: 10 Sep 1998 05:24:42 GMT
From: dha@panix.com (David Adler)
Subject: Re: Help: Problem with Pattern-Matching
Message-Id: <6t7nqq$qu@news1.panix.com>
On Fri, 21 Aug 1998 02:50:30 GMT, Daniel Grisinger
<dgris@perrin.dimensional.com> wrote:
>[posted to comp.lang.perl.misc and mailed to the cited author]
>
>In article <6rhjgo$jqq$1@nnrp1.dejanews.com>
>setro@my-dejanews.com wrote:
>
>>Example: "Many greetings to Petra and Sebastian!"
>>result: "ManyGreetingsToPetraAndSebastian!"
>
>$string = 'Many greetings to Petra and Sebastion!';
>$string = join '', map { ucfirst(lc) } split / /, $string;
Talk about frustrating. I was going through this whole thread
thinking, "why isn't anyone using split?", and was about to post
something very like this, but you got here first.
Dang.
Ah, well, easy come, easy go...
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"A Marine that says 'gee whiz'? What's he gonna do, storm the
Cunningham house?" - mst3k
------------------------------
Date: 10 Sep 1998 02:50:38 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: History of Perl - round 1
Message-Id: <6t7epu$krr2@mercury.adc.com>
In article <35F72883.16B9AE95@bbnplanet.com>,
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
>I spell correctly but noone seems to note that. ;)
^^^^^
That should be two words. ;^>
Sorry. Couldn't resist. Please don't hit me.
Brand
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications, ATM Transport Division
|_____| Richardson, Texas
------------------------------
Date: Thu, 10 Sep 1998 00:11:45 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: History of Perl - round 1
Message-Id: <1df45a6.ipw7mwigzgfoN@bay1-264.quincy.ziplink.net>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
> so I could really care
> less about a capital letter here or there.
Could you?
;-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 10 Sep 1998 05:35:17 GMT
From: dha@panix.com (David Adler)
Subject: Re: History of Perl - round 1
Message-Id: <6t7oel$qu@news1.panix.com>
On 10 Sep 1998 02:50:38 GMT, Brand Hilton <bhilton@tsg.adc.com> wrote:
>In article <35F72883.16B9AE95@bbnplanet.com>,
>Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
>>I spell correctly but noone seems to note that. ;)
> ^^^^^
>That should be two words. ;^>
>
>Sorry. Couldn't resist. Please don't hit me.
Ah, I see you've met elaine...
running for cover...
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"If it's not Jewish, it's CRAP!:)" - IsraelBeta on #DWC
------------------------------
Date: Thu, 10 Sep 1998 13:31:50 +0900
From: "novice" <peace1@writeme.com>
Subject: How can I draw simple chart using perl?
Message-Id: <6t7ko2$2n4$1@usenet.kreonet.re.kr>
Hello, there!
I wanna draw simple chart using perl like below but graphically.(not
text!!!)
(I actually wanna draw chart similar to UNIX performance meter.)
| *** ***
| * * * *
| * * * *
|* *** **
|_______________________
Which is the best & simple way to draw chart using perl?
Regards,
novice (mailto:peace1@writeme.com)
------------------------------
Date: Wed, 9 Sep 1998 14:55:25 -0400
From: "Brian Sayatovic" <BrianS@CGGSoftwareDOTcom>
Subject: Inheritance
Message-Id: <35f6ce98.0@news.one.net>
If there are three classes:
C derived from B derived from A
How can I call up the chain of constructors?
package C;
use B;
@ISA = ("B");
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = $class->SUPER::new;
bless($self, $class);
return $self;
}
In this case, when $class->SUPER::new is called, it will actually call
B::new with a class name of 'C'. But this isn't what I really want is it?
Shouldn't I want the class in the constructor of 'B' to be of type 'B'
regardless of where it is called from?
It seems I'm running into all sorts of trouble because of something related
to this. In my constructors for A, B and C, I have a call to an inherited
method in A...
$self->routine;
However, it doesn't seem to get called at all when I use the SUPER method of
callign the parent's constructor. However, if I change my calls to:
$self->routine(<whatever_classname_this_is>)
it works.
Brian J. Sayatovic
CG&G Software Plus, Inc.
(mailto:BrianS@CGGSoftware.com)
------------------------------
Date: Thu, 10 Sep 1998 00:11:51 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: IO::File Permissions - Enlightened!
Message-Id: <1df45cp.7s36js1j3yzuoN@bay1-264.quincy.ziplink.net>
[posted and mailed]
[Bill - it appears that your newsreader is not setting the References:
header properly.]
Bill 'Sneex' Jones <sneaker@sneex.fccj.org> wrote:
> Ronald J Kimball wrote:
> >
> > Here, we see that if MODE *is* numeric, IO::FILE::open() calls sysopen,
> > with the PERMS argument, and returns the result.
> >
> > my $fh = new IO::File $file, O_WRONLY|O_APPEND, 0600;
>
> First of all allow me to thank you for helping
> clear things up :]
I'm glad things are coming together!
> However, when you say mode, do you mean perms?
Actually, when I say mode, I mean the read/write mode; the second
argument to sysopen() and IO::File::open(). When I say perms, I refer
to the file access permissions; the third argument to sysopen and
IO::File::open(). That's the way 'mode' and 'perms' are used in the
documentation for open() and IO::File.
Perhaps that caused some of the confusion.
> Anyways, I can use POSIX; and the following should work:
>
> [code snipped]
>
> And, as testing it shows, it works wonderfully :]
Yay!
> As a side note, when you say 'tsk tsk tsk', is that bad?
> Is my syntax all that terrible?
I was not tsking your syntax, I was tsking that fact that you said you
got an error doing O_WRONLY|O_APPEND, when you had actually gotten an
error doing O_APPEND. :-)
> Also, if I remember correctly from my C days millions
> of years ago, I could have sworn that O_APPEND implied
> create if it does not exist, and writing was implied as well.
Perhaps, but not as far as I know. But that could be one of those
system-dependent things, ya know. Anyway, you can use O_CREAT for
creating.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 09 Sep 1998 20:58:51 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: local mail deliviry?
Message-Id: <ylemtkehz8.fsf@windlord.stanford.edu>
Stephan Jager <stephanj@sci.kun.nl> writes:
> But now I have a problem, I have a .forward, and what I want to do is
> send an email to myself (at the same machine), without the .forward
> be-ing used. since I couldn't find out how to do such a thing with
> sendmail, I made something that adds the email to my own mailbox
Try using sendmail and sending the mail to \username instead of username.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 10 Sep 1998 03:30:28 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Opening in a windows 95 serial port with perl.
Message-Id: <1998091003302800.XAA04063@ladder01.news.aol.com>
Hi Duncan:
>The program worked under windows NT but now due to hardware
>incompatibility of NT we have had to switch top 95 and the perl
>program does not work.
I suspect the program was not very reliable under NT either.
>I think its gos something to do with the mode and the way it
>sets up the com port.
>
>In NT this line :
> mode COM1:4800,n,8,1
Most people had to add additional parameters to MODE on NT.
Of course, those parameters aren't supported on Win95.
>is enough to set up the com port then I just open it using :
> open FH, 'COM1':
>
>For some reson this will not work under windowsa 95. I have
Well known bug.
>tested the com port and outpit is being generated but I can't
>get the perl program to read it.
You want Win32::SerialPort from CPAN. Last time I checked, you
still needed to go to authors/id/B/BB/BBIRTH, but the other links
may have propagated by now. You will need to check the docs
(and the demos) since the port is not opened as a filehandle and
the parameters are set individually rather than via "system (MODE..)".
Demo4.plx and demo5.plx are probably closest to what you need.
Ask if you have any problems.
SerialPort is also on my website at:
### http://members.aol.com/bbirthisel/alpha.html
(the module is actually in beta, I kept the path to keep links happy)
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: 10 Sep 1998 03:26:53 GMT
From: cselton@hkp.hk (cs - Elton Kong)
Subject: Passing file handles
Message-Id: <6t7gtt$qmg6@hkpa05.polyu.edu.hk>
Hi!
I would like to know how I can pass a file handle to a sub-routine.
I'm played with different syntax combinations to no success. Could
anyone help? Thanks!
Elton
--
-|-
.-'~~~`-. IN MEMORY OF..
.' `.
| R I P | Elton Kong
| | mailto:cselton@polyu.edu.hk
| | http://www.acad.polyu.edu.hk/~cselton/
\\| |// ICQ:8990973
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
------------------------------
Date: 10 Sep 1998 03:27:51 GMT
From: schutzmd@SPAMFREEjmu.edu (Mike)
Subject: Re: Perl "<!--#exec" with IIS, How?
Message-Id: <6t7gvn$3kv$1@lark.jmu.edu>
Steve Linberg (linberg@literacy.upenn.edu) wrote:
> IIS can be configured execute SSI's. Beyond that, you have to have the
> programs you want to run; I don't think "cat" works under NT, for
> example. Sometimes there are equivalents. You'll have to read up on the
> specific things you want to do.
It might depend on the server being used. At work I have the priviledge
<cough!> to work on an NT server running Netscape Enterprise Server. On
our server, we have a whole slew of unix-like commands, including cat. I
don't know if that is server dependant or not.
- mike -
------------------------------
Date: 10 Sep 1998 14:28:32 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6t7khg$jvj$1@godzilla.zeta.org.au>
In <tsFJ1.545$E9.1882388@ptah.visi.com> George Reese <borg@imaginary.com> writes:
>: Unfortunately, choice of programming language, for many people, is like
>: choice of religion. And how many people can discuss religion in a mature
>: fashion? :-)
>This is a fallacy. Religion cannot be discussed rationally because
>religious backers tend to fall back on positions outside of logic to
>support their claims.
And how is that diffrent to Language? In most cases the languge argument
collapes down to "I like lang X because I think in a style that lang X is
able to express well.".
> Languages, on the other hand, can be compared on their merits.
What factors do you think a good language has over a poor one?
------------------------------
Date: 09 Sep 1998 21:46:04 PDT
From: Patricia Shanahan <pats@acm.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35F7592E.93C99F9D@acm.org>
David Formosa wrote:
>
> In <tsFJ1.545$E9.1882388@ptah.visi.com> George Reese <borg@imaginary.com> writes:
>
> >: Unfortunately, choice of programming language, for many people, is like
> >: choice of religion. And how many people can discuss religion in a mature
> >: fashion? :-)
>
> >This is a fallacy. Religion cannot be discussed rationally because
> >religious backers tend to fall back on positions outside of logic to
> >support their claims.
>
> And how is that diffrent to Language? In most cases the languge argument
> collapes down to "I like lang X because I think in a style that lang X is
> able to express well.".
>
> > Languages, on the other hand, can be compared on their merits.
>
> What factors do you think a good language has over a poor one?
Comparison of languages does not have to be, and usually should not
be, "good" vs. "poor", but more a matter of relative suitability for
different jobs. It is rare for language A to be better than language B
in all circumstances for all programs.
How is one ever going to make a rational choice of languages for
projects without comparing them? Put the names of the available
languages on the wall and throw darts? Pick the first language one
learned and use it for everything?
Patricia
Patricia
------------------------------
Date: Thu, 10 Sep 1998 05:22:52 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <MmJJ1.591$E9.2050246@ptah.visi.com>
In comp.lang.java.programmer David Formosa <dformosa@zeta.org.au> wrote:
: In <tsFJ1.545$E9.1882388@ptah.visi.com> George Reese <borg@imaginary.com> writes:
:>: Unfortunately, choice of programming language, for many people, is like
:>: choice of religion. And how many people can discuss religion in a mature
:>: fashion? :-)
:>This is a fallacy. Religion cannot be discussed rationally because
:>religious backers tend to fall back on positions outside of logic to
:>support their claims.
: And how is that diffrent to Language? In most cases the languge argument
: collapes down to "I like lang X because I think in a style that lang X is
: able to express well.".
That's a valid comparison.
:> Languages, on the other hand, can be compared on their merits.
: What factors do you think a good language has over a poor one?
It depends on the ends being discussed.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: 10 Sep 1998 14:22:48 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl Data Structures: trees etc...
Message-Id: <6t7k6o$jig$1@godzilla.zeta.org.au>
In <6t7c93$o4g$1@monet.op.net> mjd@op.net (Mark-Jason Dominus) writes:
>In article <6t72bl$qes$1@godzilla.zeta.org.au>,
>David Formosa <dformosa@zeta.org.au> wrote:
>>Hierarchically nested hashes are trees.
>So they are. But they're trees in an awfully funny way.
Most peaple seem to think of trees like this (pydo-code)
treenode = record
Key
Data
Leftchild = ^treenode
Rightchild = ^treenode
end treenode
But personal I prefer a tree like this.
treenode = record
Key
Data
children[BOOLEAN] = ^treenode
end treenode
Cause it saved me writing in other sections of the code. Of cause in perl
I would do something like this.
Package Tree::Node;
sub new () {
my $class=shift;
my $self= {
KEY => shift,
DATA => shift,
CHILDREN => [@_],
}
return bless $self,$class;
}
------------------------------
Date: 10 Sep 1998 01:44:22 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl Data Structures: trees etc...
Message-Id: <x7n288zfm1.fsf@sysarch.com>
>>>>> "DF" == David Formosa <dformosa@zeta.org.au> writes:
DF> In <6t7c93$o4g$1@monet.op.net> mjd@op.net (Mark-Jason Dominus) writes:
>> In article <6t72bl$qes$1@godzilla.zeta.org.au>,
>> David Formosa <dformosa@zeta.org.au> wrote:
>>> Hierarchically nested hashes are trees.
>> So they are. But they're trees in an awfully funny way.
DF> Most peaple seem to think of trees like this (pydo-code)
DF> treenode = record
DF> Key
DF> Data
DF> Leftchild = ^treenode
DF> Rightchild = ^treenode
DF> end treenode
DF> But personal I prefer a tree like this.
DF> treenode = record
DF> Key
DF> Data
DF> children[BOOLEAN] = ^treenode
DF> end treenode
the implementation of a tree is irrelevant to whether the data
structure is interpreted as a tree. i have implemented a tree in a
single perl4 array (with lots of painful code). so a hash of hashes is a
tree if you treat it like one. how each node/branch is created is not
important to understanding the hierarchal nature of the data.
the representation of data is not the same as its interpretation. they
can be similar but that is not a requirement and sometimes it is very
difficult to achieve (depending on the language and development
environment).
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Thu, 10 Sep 1998 04:46:20 GMT
From: dmorel <dmorel@stny.lrun.com>
Subject: Perl-Cgi-htaccess is this as simple as I think it is?
Message-Id: <35F75A4E.2CEF8A2B@stny.lrun.com>
Hi,
I am barely a novice perl programer, but I am getting around ok.
Here is my concern, I need to password protect a directory, assigning
permissions on the fly, for those that register, but here is the catch.
I need
to set a variable for the number of times they are allowed to enter.
So, the password and username, could be used only once, or
500 times (or whatever number)
My programing concern here is that this seems like a pretty easy task,
since
using .htaccess you can more or less call your .htpasswd file whatever
you want.
This being the case, could I not have a script that would read the
contents
of a form (user-name, password, number of times allowed) and write this
information to a file on a directory only accesible from root (so it
would be secure)
Then, have it write the same information, minus the number of times
allowed, to
another file, which would be the file refreanced in my AuthUserFile line
in
.htaccess
So in doing this, I have allowed my user to create her own password, and
now,
when she logs in, I run a script that goes to the first file, and
decreases the number
of logins allowed by 1 and then an if statment saying if it is less then
1 (or equal to zero?)
go to the other file, read it, and delete the line on which this user
name exsists.
Having entered the secure area to get the page on which the script
resides,
a user with only 1 allowed access, would not get in more then once, as
the
password and username would be deleted after entry.
This seems to me to be a relatively easy thing to do, relative in the
sense that I have
some real good books on perl, and would know how to do it in C++
But I spent some time looking for scripts like this and did not find
any.
One of the things that scared me was that I was not sure how to deal
with the encryption
of the password, but I did find a script someone wrote to generate the
encryption, so
I am presuming I can just make this part a function of the sign up page
where I write the
files to begin with.
And now, I get to the reason of this post.
Am I correct? Can I do this in perl, and if so, is it a good idea.
Or is my newbie perl/cgi mind missing something very obvious?
Any thoughts or comments on either the procedure or the
concept as a whole would be most apreciated.
Regards,
-david
------------------------------
Date: Thu, 10 Sep 1998 05:34:03 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: QUESTIONS (was: Perl Programmer Needed)
Message-Id: <6t7oca$o23$1@nnrp1.dejanews.com>
In article <1df3s6u.ygpmbb192ze6mN@bay1-161.quincy.ziplink.net>,
rjk@coos.dartmouth.edu (Ronald J Kimball) wrote:
> That was hilarious! Although it was rather frightening that several
> people responded apparently unaware that it was in jest. Some people
> just don't understand satire.
>
> Anyone who thinks this was a joke needs to pay more attention to From:
^^^
!!!
Hey! You left off the n't! (or should I say NT?). Or are you just
"one-upping" me in public again! :) <-(necessary smiley, apparently:)
For the record (although I secretly believe Craig is just trying to
beat me at my own game), I set out to cover as much ground as I could
with my original posting:
1. Give a meaningless subject like "QUESTIONS" 2. Use incomplete sentences
and poor grammer 3. No uppercase or punctuation (recently slammed on clpm)
4. Be arrogant, in general 5. Be clueless, in general 6. Post a job
advertisement 7. Praise Microsoft 8. Praise NT and ASP 9. Refer to HTML as
"programming" 10. Throw in a "Norm Crosby", type of mis-speak (back of *my*
hand) 11. Blame Perl for web server mis-configurations 12. Slam Perl in a
Perl newsgroup 13. Be presumptious, in general 14. Post 3 consecutive FAQ's,
(virtually verbatim from perlfaq 9 - Networking):
a. My CGI script runs from the command line but not the browser.
(500 Server Error)
b. How do I extract URLs?
c. How do I decode a CGI form?
15. Slam the Perl docs
16. Demand an E-mailed response instead of a c.l.p.m. response
17. Then proceed to munge my address
18. Use Hitler bait
I don't really know why I did it ... it all happened so fast.
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 10 Sep 1998 00:11:52 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Regular Expression - substitution from lower to upper case...how?
Message-Id: <1df45ua.cx75ammvrrxkN@bay1-264.quincy.ziplink.net>
Jules <julius@clara.net> wrote:
> Dear all, please tell me how I could use the substitution expression to
> convert all lowercase characters to uppercase?
Don't use substitution, use uc().
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Wed, 9 Sep 1998 20:10:48 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Script doesn't like text fields?
Message-Id: <ou87t6.mr9.ln@metronet.com>
Amy O'Neill Houck (theteam@pinkworks.com) wrote:
: Hi, I'm using a pre-fab form processing script which keeps telling me I
: haven't filled out fields that are indeed filled out.
: Can anyone give me any ideas why?
Contact the author of the script.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 10 Sep 1998 13:16:32 +1000
From: "Andrew Pollock" <apollock@bit.net.au>
Subject: SNMP examples
Message-Id: <6t7gag$tnl$1@hermes.bit.net.au>
Does anyone have any sample code using the SNMP module that they'd be
willing to share?
Thanks
Andrew
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3675
**************************************