[13057] in Perl-Users-Digest
Perl-Users Digest, Issue: 467 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 11 18:07:19 1999
Date: Wed, 11 Aug 1999 15:05:08 -0700 (PDT)
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, 11 Aug 1999 Volume: 9 Number: 467
Today's topics:
ANNOUNCE: libxml-perl-0.04 <ken@bitsko.slc.ut.us>
Re: Another quick question...Arrays...testing against <mj.stevenson@auckland.ac.nz>
Re: Another quick question...Arrays...testing against (I R A Darth Aggie)
Re: bug in 'unpack'? <hal_mounce@amdahl.com>
Database conversion <sunny@ualberta.ca>
Re: Help - Split Function Blowing My Mind Away!! (Larry Rosler)
Re: HELP <USENET@questionexchange.com>
Re: list length <nospam@nospam.com>
Making a new web page out of an existing page (Eddie)
Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!??????????? <aperrin@mcmahon.qal.berkeley.edu>
Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!??????????? <schmickl@magnet.at>
Re: Parse::RecDescent, optional subrules, and errors (Damian Conway)
Re: Perl is eating up my memory <kperrier@blkbox.com>
Re: perl on linux <mike@crusaders.no>
PERL on Windows: Print displays only blank lines <isputnik@email.msn.com>
perl won't complie with Berkeley DB <systems@imag.net>
Position Open At SunSpot <mseldin@clark.net>
Re: Problem reading forms with perl <tex@engsoc.carleton.ca>
Re: Problem reading forms with perl genelong@my-deja.com
Re: Sesssion ID (Greg Bacon)
Re: UpperCase first letter of string only. <nospam@nospam.com>
Re: while loop teminates too early (Larry Rosler)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Aug 1999 21:13:14 GMT
From: Ken MacLeod <ken@bitsko.slc.ut.us>
Subject: ANNOUNCE: libxml-perl-0.04
Message-Id: <7osp1a$qv$1@play.inetarena.com>
libxml-perl-0.04 is making it's way to CPAN archive sites.
libxml-perl is a collection of smaller Perl modules, scripts, and
documents for working with XML. libxml-perl software works in
combination with XML::Parser, PerlSAX, XML::DOM, XML::Grove, and
others.
<http://www.perl.org/CPAN/modules/by-module/XML/>
HTML-rendered PODs can be found on the home page,
<http://bitsko.slc.ut.us/libxml-perl/>
Changes since libxml-perl-0.03:
* The major new part of this release is a design, documentation, and
alpha implementations for modular pattern (query) and action
processing.
Briefly, patterns and actions are specified as pairs of pattern
and action statements. The pattern format or language is defined
by a pattern module and the action format or language is defined
by an action module. An action module is a PerlSAX handler and it
drives the processing by the two modules.
Included are ``Using PatAct Modules'' and ``Creating PatAct
Modules'' documents, a module for matching against simple element
names, XML::PatAct::MatchName, a module for converting XML into
Perl Objects, XML::PatAct::ToObjects, a module for simple before
and after style text replacement inspired by the Amsterdam SGML
Parser and Linuxdoc, XML::PatAct::Amsterdam, and template modules
for creating new pattern or action modules.
* A fix to XML::Parser::PerlSAX and XML::ESISParser to correct a
missing hash argument in `start_document()' and `end_document()'.
Changes since libxml-perl-0.02:
* Added a PerlSAX handler for writing Canonical XML,
XML::Handler::CanonXMLWriter.
libxml-perl contains the following:
Modules
XML::Parser::PerlSAX
XML::Handler::Sample
XML::Handler::CanonXMLWriter
XML::ESISParser
Data::Grove
Data::Grove::Parent
Data::Grove::Visitor
XML::PatAct::ActionTempl
XML::PatAct::Amsterdam
XML::PatAct::MatchName
XML::PatAct::PatternTempl
XML::PatAct::ToObjects
XML::SAX2Perl
XML::Perl2SAX
Documents
PerlSAX
Using PerlSAX
Using PatAct Modules
Creating PatAct Modules
List of Perl XML modules by category, in XML
--
Ken MacLeod
ken@bitsko.slc.ut.us
------------------------------
Date: Thu, 12 Aug 1999 09:10:36 +1200
From: Matthew Stevenson <mj.stevenson@auckland.ac.nz>
Subject: Re: Another quick question...Arrays...testing against
Message-Id: <37B1E6CC.2D635E77@auckland.ac.nz>
"(BXTC)" wrote:
> I have an array "@numbers" with values as follows (although the $#numbers
> will vary)
>
> @numbers[0] = 5
> @numbers[1] = 9
> @numbers[2] = 19
> @numbers[3] = 12
> @numbers[4] = 6
>
> And I also have a string $target whose value is....(this also will vary)
>
> $target = 9 (and it is actually the number of elements in another
> array....$#target)
>
> Now I need to search each value of @numbers to see if ANY of them equals
> $target.
$match=0;
foreach $value (@numbers){
if( $value == $target ){
$match=1;
}
}
--
Matthew Stevenson
University of Auckland
mj.stevenson@auckland.ac.nz
mavricknz@yahoo.com
------------------------------
Date: 11 Aug 1999 21:26:54 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Another quick question...Arrays...testing against
Message-Id: <slrn7r3qp1.e83.fl_aggie@thepentagon.com>
On Wed, 11 Aug 1999 20:36:39 GMT, (BXTC) <bxtc@forfree.at>, in
<r9ls3.98$1B5.7574@monger.newsread.com> wrote:
+ I need to search each value of @numbers to see if ANY of them equals
+ $target.
perlfaq4: How can I tell whether a list or array contains a certain element?
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Wed, 11 Aug 1999 15:00:00 -0700
From: Hal Mounce <hal_mounce@amdahl.com>
Subject: Re: bug in 'unpack'?
Message-Id: <37B1F260.277DDE54@amdahl.com>
Tye McQueen wrote:
> "Tony Cox" <avc@sanger.ac.uk> writes:
> ) seek (IN,$sn_loc_offset,$DWORD);
> The third argument to seek() should be 0, 1, or 2, not 4.
Boy, did I miss that.
> Tye McQueen Nothing is obvious unless you are overlooking something
No kidding.
Hal
------------------------------
Date: Wed, 11 Aug 1999 15:15:33 -0600
From: "Sunny" <sunny@ualberta.ca>
Subject: Database conversion
Message-Id: <7osp2o$b9c$1@pulp.ucs.ualberta.ca>
I require some assistance from someone very familiar with Perl. I have a
file consisting of patient records. Some of the fields are LASTNAME
FIRSTNAME MIDDLENAME SEX.. I want to output these fields, along with their
values, tab delimited. However, if a particular field is not present, i.e.
MIDDLENAME, an extra tab should be left in its place:
Patient 1: LASTNAME=Doe FIRSTNAME=John MIDDLENAME=Frank SEX=M
Patient 2: LASTNAME=Dave FIRSTNAME=Mike
SEX=M
Please advise on coding for this.
Sunny
------------------------------
Date: Wed, 11 Aug 1999 14:56:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help - Split Function Blowing My Mind Away!!
Message-Id: <MPG.121b9148ac744f3d989e33@nntp.hpl.hp.com>
In article <x3ypv0u9o32.fsf@tigre.matrox.com> on Wed, 11 Aug 1999
14:20:02 -0400, Ala Qumsieh <aqumsieh@matrox.com> says...
>
> mkozlows@guy.ssc.wisc.edu (Mike Kozlowski) writes:
>
> > In article <MPG.121a4f373dba2a21989e26@nntp.hpl.hp.com>,
> > Larry Rosler <lr@hpl.hp.com> wrote:
> > >
> > >Use of incorrect context: my $x = @_; my ($y) = @_;
> >
> > Are you saying that both of those are wrong, or that the first is wrong
> > and the second correct?
>
> The first form assigns to $x the number of elements in @_.
Which may be interesting, but probably not what was intended (i.e., a
surprise), and not very useful.
> The second form assigns to $x the first element of @_.
Actually, to $y in the example. Likely to be what was intended, and to
be useful. But I would probably write that line thus:
my $y = shift;
or, if I were concerned about the microscopic inefficiency of the shift,
my $y = $_[0];
Assigning an array @_ to a one-element array slice ($y) rubs across the
grain, somehow.
So, in answer to Mike Kozlowski's question, each of those is 'wrong',
for some definition of 'wrong'. But the second one is likely to be
useful.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 11 Aug 1999 21:56:39 GMT
From: QuestionExchange <USENET@questionexchange.com>
Subject: Re: HELP
Message-Id: <772qx@questionexchange.com>
> I have a problem on determining a RE:
> I use UNPACK function with the format "A11A12A256A12A41A31".
> I would like to sum every length field "A" with a RE (for
> example, the
> result of this format should be 363).
> I have tried this but it isn't very powerfull!
> ------code-------------------------------------------
> #!/usr/bin/perl
> $format = "A11A12A256A12A41A31";
> @t = split(/A/, $format); $len = 0;
> for $x (@t) {$len += $x;}
> print "somme=$len\n";
> ------code-------------------------------------------
> How can I manage this?
> Thanks,
> Dominique Crétel
your code to the shorter
$len = 0;
for (split /A/, $format) { $len += $_ }
If you don't care about the string
remaining as it is, you can of course
be really crude:
$format =~ s/(\d+)/$len+=$1;$1/ge;
or do
while($format =~ /(\d+)/g) { $len += $1 }
There are always many ways to do it.
--
This answer is courtesy of QuestionExchange.com
http://www.questionexchange.com/servlet1/showUsenetGuest?ans_id=2591&cus_id=USENET&qtn_id=1663
------------------------------
Date: Wed, 11 Aug 1999 16:53:25 -0500
From: "William M." <nospam@nospam.com>
Subject: Re: list length
Message-Id: <37B1F0D5.F1455B20@nospam.com>
Based on your attempts, I'm not sure if this answers your question, but
here goes anyway.
@listarray=("One","Two","Three","Four");
print "There are $#listarray elements (starting at zero), and the last
one is $listarray[$#listarray]\n";
print "All of them are:\n",join("\n",@listarray),"\n";
My $0.02 follows (to others, not to the poster).
<soapbox>
Be nice to newbees when they appear.
</soapbox>
Gerhard Muth wrote:
> Simple Question:
>
> Is there a way to get the number of elements of a list WITHOUT
> assigning it to a variable?
>
> e.g. Thread->list gives a list of Threads. This works fine but is
> not what I want:
>
> @l = Thread->list;
> print $#l." threads in list";
>
> I looked to a lot documentation as well as faqs but could not
> find a method or function to get the number of elems of the list.
>
> I would expect something like Thread->list->length or
> length(Thread->list)
> or anything else.
>
> Cheers,
> Gerhard
------------------------------
Date: Wed, 11 Aug 1999 21:43:51 GMT
From: (Eddie)
Subject: Making a new web page out of an existing page
Message-Id: <37b1eddb.102089770@news.cadvision.com>
Is it possible to create a web page by "stealing" certain text
passages from an existing web page on your web server? I've never
used perl before but if it can do this i'd like to start learning it.
The script would have to search for certain text in a filename and
then generate a new web page using an existing template.
------------------------------
Date: Wed, 11 Aug 1999 14:03:07 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!?????????????????????????
Message-Id: <37B1E50B.83A50D4F@mcmahon.qal.berkeley.edu>
Thomas M. Schmickl wrote:
>
> > It is the 'net way of saying:
> >
> > I will never see anymore posts from you
> >
> >
> > The 'K' key is how you make a killfile entry is some popular
> > newsreader software.
> Thats one of the inventions that should have ne ver been made !
>
Quite the contrary - it's an essential feature of 'net life. Personally,
I'm considering setting one up to match anything whose subject line is
in ALL CAPS or contains 2 or more of the same punctuation mark in a row.
> I am somebody who always insists on the freedom of speech
> which gets useless if nobody listens you.
>
You've got this exactly backward; stuff that gets killfiled is useless
long before it's ignored. You think being ignored makes speech useless;
in fact, it's that being useless makes speech ignored.
>In Europe we had also
> things like this (in the dark middle age). Some there taken to the
> "PRANGER" where
> everybody could spit and lough at them, others were marked with some
> signs, so
> that they became lower then the normal citizens.
Usenet is much nicer, isn't it? Now we just ignore them and they go off
quietly into the night.
> And even guys like hitler denied some
> part of the population the right of speech and the systematically closed
> the ears of the majority
> for the arguments of these (belived) lower human beings. The majority
> realy thought
> it had the right to first ignore them, later punish them and afterward
> kill them.
> As we all know, this should better not have happend. I am from austia, a
> land that
> was part of this regime just a few decades ago, so I am very sensible to
> all kinds
> of arrogant totalitarism and censorship.
That was quick - who was it that suggested a measure of usenet hostility
by how quickly the holocaust was used as a metaphor for on-line
discussions?
>
> Why do you thing that some other human beeings should just be silenced in
> this (or other) newsgoup(s). ???
>
I see no justification for a claim that people must read everything that
gets written - we select based on subject matter, language, clarity,
etc., all the time. Why shouldn't we be able to select for intelligence?
> Ciao, thomas.
--
-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting -
aperrin@mcmahon.qal.berkeley.edu
I'M LOOKING FOR ANOTHER EXPERIENCED ACCESS
DEVELOPER - CONTACT ME IF INTERESTED.
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: Wed, 11 Aug 1999 23:54:32 +0200
From: Thomas Schmickl <schmickl@magnet.at>
To: Tad McClellan <tadmc@metronet.com>
Subject: Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!?????????????????????????
Message-Id: <37B1F118.EBFABCF8@magnet.at>
Tad McClellan schrieb:
> [ stealth Ccs are evil! ]
>
What does that mean ? my mother tounge is not english, so I do not know
whatt ccs are. The dictionary doesnt know it either. (I only know thew
stealth bomber, it flies sometimes over europe).
> Thomas M. Schmickl (schmickl@magnet.at) wrote:
> : tadmc@metronet.com writes:
> : > It has nothing to do with Perl.
>
> That was a private email.
>
> I did not give you permission to post it.
>
> It is _very_ bad manners to post private email publically.
>
> Please don't do that anymore.
>
Sorry, I didn't see that it was private !
I post my excuse public too , so I hope you are not angry anymore.
ciao, thomas.
------------------------------
Date: 11 Aug 1999 21:41:09 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Parse::RecDescent, optional subrules, and errors
Message-Id: <7osqll$ndv$1@towncrier.cc.monash.edu.au>
rand@qualityic.com (Rand Bamberg) writes:
> Any Parse::RecDescent users reading? (Or perhaps Mr. Conway
> himself?)
Nope, my father isn't reading this ;-)
> I'm having trouble with error reporting and optional subrules in a
> production,
Error messages are generated by comparing what was expected and what
was found *at the point where parsing failed*. As you point out, errors
generated by optional subrules are always pruned (since the "match zero
times" alternative always ensures success).
Perhaps a better heuristic would be only to prune errors that were
generated by a failure at the start of the subrule. That is, if the
subrule partially succeeds, keep the error around (even when other
errors are pruned) in case a higher-level rule later fails (indicating
that the optional subrule may have been meant to succeed).
> file : '(' 'FILE' headers fruit ')' /\Z/
> headers: version(?) rev(?)
> version: '(' 'VERSION' /\d+/ ')' | <error>
> rev : '(' 'REV' /\d+/ ')' | <error>
> fruit : '(' 'FRUIT' /\w+/ ')' | <error>
> This produces:
> ERROR (line 1): Invalid fruit: Was expecting 'FRUIT'
> but found "REV X) (FRUIT banana))" instead
> I was expecting it to complain about X, not FRUIT.
'rev' fails, but 'rev(?)' succeeds, so 'headers' succeeds, so the errors
generated by the failure of 'rev' are pruned.
> I discovered that if I made the subrule rev
> non-optional ("headers: version(?) rev"), it would work:
> ERROR (line 1): Invalid rev: Was expecting /\d+/
> but found "X) (FRUIT banana))" instead
Because now the failure of 'rev' causes 'headers' to fail as well, so
the errors aren't pruned.
> Alternatively, I found another way to trigger expected
> results was to inline the "headers" rule:
> file : '(' 'FILE' version(?) rev(?) fruit ')' /\Z/
> ERROR (line 1): Invalid rev: Was expecting /\d+/
> but found "X) (FRUIT banana))" instead
> ERROR (line 1): Invalid fruit: Was expecting 'FRUIT'
> but found "REV X) (FRUIT banana))" instead
This is because the errors generated by optional subrules are
currently pruned at the *end* of the enclosing rule. When 'rev(?)' is
part of 'headers', the message gets pruned at the end of 'headers'
(i.e. before 'fruit' is tried). When 'rev(?)' is part of 'file',
the error isn't pruned till the end of 'file', so it's still around
when 'fruit' fails.
> From looking at $::RD_TRACE, I can tell that
> rule:rev fires and fails each time; it's just a question
> of whether that error gets pruned or not.
Exactly.
> Any ideas on what's going on here, or, at least, how I
> can get the desired behaviour without in-lining?
There's no way you can at present :-(
Clearly the error pruning heuristics need another tweak.
I'll queue it in my ToDo file.
Sorry,
Damian
------------------------------
Date: 11 Aug 1999 16:05:34 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Perl is eating up my memory
Message-Id: <A465CC94ACAE4531.E72DF824580A4A1B.F2C9C5A7B0010571@lp.airnews.net>
"Chao Fang" <cfang@nwu.edu> writes:
> I used a array to hold 8M of one digit number. However Perl used up to 240M
> of memory and the process is hang up finally.
>
> I run the script on a SUN Ultra5 with 128M and Solaris. I use 'top' command
> to watch how much memory is used.
>
> The script is quite simple and the array is the only main data structure.
> You can try by just filling enough data in an array and watch what is
> happening.
>
> Is the answer that Perl is not suitable to process great amount of data?
>
No one can really answer that unless we see some code.
Kent
------------------------------
Date: Thu, 12 Aug 1999 00:04:28 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: perl on linux
Message-Id: <Lqms3.610$wU.5297@news1.online.no>
Ala Qumsieh <aqumsieh@matrox.com> wrote in message
news:x3ywvv29qy5.fsf@tigre.matrox.com...
> > perl -e 'while(<>){s/\cM//g;print}' < oldscript.pl > fixedscript.pl
> Haven't heard of the -p and -n flags?
Actually... No.
> or even the -i flag?
I know what it's for, but I haven't used it.
> % perl -pi -e 's/\cM//g' oldscript.pl > fixedscript.pl
OK, seems a bit nicer.
> % perldoc perlrun
I will.
--
Trond Michelsen
------------------------------
Date: Wed, 11 Aug 1999 17:31:00 -0700
From: "netnews.msn.com" <isputnik@email.msn.com>
Subject: PERL on Windows: Print displays only blank lines
Message-Id: <eQutlBE5#GA.120@cpmsnbbsa03>
I moved some of my Unix Perl scritps to Windows NT. The basic Print command
doesn't work NT - Is there any environement setup that needs to be done?
Thx -Sputnik-
------------------------------
Date: Wed, 11 Aug 1999 14:43:12 -0700
From: "Luke Cowell" <systems@imag.net>
Subject: perl won't complie with Berkeley DB
Message-Id: <C6ms3.2809$M5.7500@newsfeed.slurp.net>
I'm trying to compile perl with berkeley db support on an ultra sparc. Here
is the ouput I get during my config.
Checking Berkeley DB version ...
I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB.
and later we see.
lib/db-btree.......skipping test on this platform
lib/db-hash........skipping test on this platform
lib/db-recno.......skipping test on this platform
I've downloaded the latest version of db.
This may or may not have anything to do with it, but when I try to use
DB_File i get this message when I try to run it.
ld.so.1: /usr/bin/perl: fatal: relocation error: file
/usr/local/lib/perl5/5.00502/sun4-solaris/auto/DB_File/DB_File.so: symbol
db_version: referenced symbol not found
Please Help
tia
--
Luke Cowell - systems@imag.net
Systems Administrator
Imaginet Communication Group Inc.
http://www.imag.net
------------------------------
Date: Wed, 11 Aug 1999 21:37:16 GMT
From: "Marc Seldin" <mseldin@clark.net>
Subject: Position Open At SunSpot
Message-Id: <g2ms3.2961$Jd5.1638443@dca1-nnrp1.news.digex.net>
SunSpot, the web site of The Baltimore Sun, has a Programmer Analyst
position open. I'm looking for a perl/sql/solaris junkie with a few years of
experience to assume a lot of responsibility for the site. Casual
atmosphere, telecommuting days, Quake after hours. Send me a resume, be sure
to let me know how much you're looking for.
mseldin@sunspot.net
--
________________________
Marc Seldin
Chief Technology Officer, Online
(410) 468-2634 office
------------------------------
Date: 11 Aug 1999 21:15:21 GMT
From: Clayton L. Scott <tex@engsoc.carleton.ca>
Subject: Re: Problem reading forms with perl
Message-Id: <7osp59$ph2$1@bertrand.ccs.carleton.ca>
You, yes you, genelong@my-deja.com. Stop writing crap like this:
: Give me a break, Abigail. I DON'T HAVE A MANUAL. I'm trying to get
: one. I never heard of the "standard distribution" until a few days ago
: on this list.
C:\path-to-perl\html\index.html
Clayton
------------------------------
Date: Wed, 11 Aug 1999 21:13:16 GMT
From: genelong@my-deja.com
Subject: Re: Problem reading forms with perl
Message-Id: <7osp15$r5o$1@nnrp1.deja.com>
In article <viIr3.680$aT1.6993@news1.online.no>,
"Trond Michelsen" <mike@crusaders.no> wrote:
>
> <genelong@my-deja.com> wrote in message news:7oned1
$16n$1@nnrp1.deja.com...
> > I went to activestate.com, and there are a lot of things to
download.
> > Which one(s) do I need?
>
> I agree that it's not immediately obvious where the Perl installation
is
> located, but in the menu there is a link to "ActivePerl" (ActiveState
likes
> to add "Active" to their software) which is what you need.
>
> http://www.activestate.com/ActivePerl/download.htm#complete
Thanks, Trond, I will give that a try.
>
> > Is the "standard distribution" basically a perl compiler? Why
would I
> > want to compile my perl when the server interprets the source? Or
is
> > it just for documentation purposes?
>
> You're confusing perl with cgi. The webserver does not interpret perl
at
> all. When you access a .cgi-file (well, this depends on your
> server-configuration of course) the server will basically execute that
> program as a shell program and direct it's output back to the browser
that
> sent the request. If that program is a Perl-script it's compiled by
the
> perl-compiler.
Let me get some terminology straight. By a .cgi-file do you mean a
file in cgi-bin, or a file with an extension of .cgi-file? I found the
file extensions/file types seem to make no difference, and I generally
name my files .pl for perl, since I understand that many languages can
be used for a cgi script, not just perl. (I tried to use C++ for a cgi
without success - still don't understand what I did wrong, but that's a
topic for another day). My understanding is that perl is a language,
and cgi is a method of executing a language, perl or otherwise on the
server to do a function for a client. Is this right?
I don't know what you mean by a shell program. When I say interpret, I
mean that I only load the source code out on the server, not the
compiled object code. I doubt it is compiled on the fly, so I assume
the source is interpreted during actual execution. I have heard one
can also compile a program and put the compilation output, like an .exe
file, out on the server, but I don't understand how an .exe file could
run on unix, since that is a dos/windows extension.
>
> Also beware that if you want to run your scripts from a web-browser,
you
> need to install a web-server as well. I would recommend a visit to
> http://www.apache.org/ to get that.
Ack!!! I don't want to install a web-server on my home machine! I just
want to run my nice Windows 98 and ftp programs out to my isp when I
want to modify my web site. Why would I need to install a web server
at home?
> > There seems to be a huge communication gap between unix and windows
> > programmers. Where do people enter commands such as perldoc (or
> > whatever it was) in Windows? Windows consists of icons and screens,
> > not command lines. The only way I know of entering commands is
opening
> > a DOS window, and I would think DOS has nothing to do with perl.
>
> That's probably an easy mistake to make, but after a normal
installation of
> ActivePerl you will find that perldoc will work from DOS as well.
> Of course. ActivePerl will also install the documentation in HTML-
format, so
> the easiest way to access the docs in windows is ofcourse to click
your way
> through the start-menu.
> However - you should never underestimate the power of a command-line
> utility.
>
> > I am glad to get a hold of all these resources to enhance my
knowledge
> > of perl, but I also feel I am buying a car when all I want to do is
go
> > to the house next door. Is all this really necessary to read angle
> > brackets from a form? I see forms all the time that let users enter
>
> In short: Yes.
>
> If you want to parse the data from a form you need a program.
> If you want that program to be a perl-program you need a perl
interpreter
> and compiler
> If you don't want to reinvent a lot of smooth wheels you need a good
set of
> modules.
>
> In addition you also need the webserver of course.
>
> All this is needed so that you can run scripts locally on your own
machine.
> If you have a webpage at an ISP, your ISP already has a webserver. If
you
> want to parse forms on that webpage you need to contact your ISP to
find out
> if they offer that possibility at all etc.
Maybe this is where some of the miscommunication is coming from. I
*only* use my ISP to run perl, not my home machine. They obviously
have something, because my web site is up and running, complete with
about 20 html forms, 4 perl programs, and icons and other goodies. So
I already *do* interpret input from forms using perl. I can pick up
input from the user, detect when he clicks on a button, take a certain
action accordingly, and write html out from my perl program to create
the next form. All that works. The only thing that does not work is
stopping the angle brackets from disappearing when they go from the
form to the perl program.
>
> > addresses such as "joe <joe@domain.com>". How do those forms get
the
> > input into some place where it can be manipulated? I will be glad
to
> > learn all these things, but if someone could hand me a line of code
> > that would do the trick, I would be greatly appreciative. It just
> > can't be that hard.
>
> When it comes to form handling you should use CGI.pm. This module
includes
> everything you could possibly need to create web-pages with fill-out
forms
> and to manipulate the data returned from the form.
Thanks, will try to find it.
But don't forget that if
> you stumble onto problems that are related to getting the script to
work
> from the webserver and getting the script to accept data from the
form you
> should ask you questions to a group that specializes in CGI-
programming
> (e.g. comp.infosystems.www.authoring.cgi)
Some more dumb questions: when you say "script", is that the same as a
program? When you say CGI-programming, do you mean perl programming,
or other cgi programming as well?
>
Are my questions more appropriate for authoring.cgi? It is hard for me
to tell which forum is more appropriate.
> BTW: The particular email-address you entered is 100% valid (I haven't
> bothered to check if domain.com exists tjough), so there is no need
for any
> scripts to manipulate it.
You misunderstand, Trond - I don't want to manipulate, I want to retain
it. Right now all text inside of angle brackets gets dropped. If I
enter "Joe <joe@domain.com>" on the form, by the time the text gets to
the program, all I have is "Joe ". I lose the rest. That's the whole
problem.
Many thanks for your helpfulness, Trond - I know this must be getting
weary for some people out there, but it is very hard to break into this
world. If people have other suggestions as to where I can go (other
than to hell <g>) to learn more, I'm open. Thanks again.
Gene
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 11 Aug 1999 21:07:15 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Sesssion ID
Message-Id: <7osom3$ni0$2@info2.uah.edu>
In article <7osmfg$12fk$1@slrn.eurobell.net>,
"Troy Knight" <flexit@flexit.eurobell.co.uk> writes:
: Okay, I want to write a login program which asks for a login name and
: password and then keeps track of which user is using the script, someone
: told me to use session id's. I have been looking on the net for ages but
: can't find info on what session id's are and how to use them. Can anyone
: help?
Have a look at these:
<URL:http://www.modperl.com/perl_conference/advanced/index.html>
<URL:http://www.modperl.com/hangman.html>
You might consider buying a copy of the Apache modules book (visit
<URL:http://www.modperl.com/>). Chapter 5 would probably be of greatest
interest to you.
Greg
--
I want to die peacefully in my sleep like my grandfather, not screaming in
terror like his passengers.
------------------------------
Date: Wed, 11 Aug 1999 16:23:53 -0500
From: "William M." <nospam@nospam.com>
Subject: Re: UpperCase first letter of string only.
Message-Id: <37B1E9E9.8C93B32A@nospam.com>
Try:
my $mystring='hello';
$mystring=ucfirst($mystring); # $mystring='Hello'
Bart Simpson wrote:
> my $mystring='hello';
>
> How would I go about changing $mystring so it contains 'Hello'? I have a
> script where names are entered, and would like to make sure the first letter
> is capitalized.
>
> --
> Phony email address.
> Reply to this newsgroup, not to email.
> Thank you.
------------------------------
Date: Wed, 11 Aug 1999 14:30:48 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: while loop teminates too early
Message-Id: <MPG.121b8b68b292e108989e32@nntp.hpl.hp.com>
In article <slrn7r3fs6.8a7.billynospam@wing.mirror.bt.co.uk> on 11 Aug
1999 18:23:01 GMT, Graham Ashton <billynospam@mirror.bt.co.uk> says...
> In article <37B1A46E.FE83E930@entpm4.prod.fedex.com>, Joel Neely wrote:
> >>
> >> > while($line=<USERS>) {
>
> that should be "while(defined( $line = <USERS> ))". what happens if
> you've got a line that evaluates to false?
Please don't perpetuate that nonsense.
For a while, in perl 5.004, there was a warning about that 'problem',
which could *never* occur in any real-life situation dealing with valid
'text files' (and if they aren't text files, why would one be reading
them a 'line' at a time?).
But smarter heads prevailed, and in perl 5.005 that 'defined' test is
implicit, just as it is when the line is read into the default $_:
while (<FILE>) {
Oh, yes -- the only line that evaluates to 'false' is when last two
characters in the file are "\n0". I can live with that perfectly well
without a warning.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 467
*************************************