[11386] in Perl-Users-Digest
Perl-Users Digest, Issue: 4984 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 26 16:07:39 1999
Date: Fri, 26 Feb 99 13:00:48 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 26 Feb 1999 Volume: 8 Number: 4984
Today's topics:
Re: Anonymous subs, closure, and packages (Ed Morris)
Re: Anonymous subs, closure, and packages (Ed Morris)
Re: Anonymous subs, closure, and packages <zenin@bawdycaste.org>
ascii values in Perl psitko@my-dejanews.com
Re: ascii values in Perl <avm@atos.be>
backticks & system() wierdness (Bart Parliman)
Re: Confused: Which Win95 perl to download? <sb@sdm.de>
database help <gala@sonic.net>
Re: database help (Steve Linberg)
Email from Perl on Windows 95 mariita@my-dejanews.com
FAQ 6.21: What's wrong with using grep or map in a void <perlfaq-suggestions@perl.com>
FAQ 6.22: How can I match strings with multibyte charac <perlfaq-suggestions@perl.com>
garbage characters after html from cgi? duverm@hotmail.com
Re: Getting user ID and password in perl script (Seshu Madhavapeddy)
Re: How can I write to an unpadded format field? (Andrew M. Langmead)
Re: IO::File <$fh> vs $fh->getline (Randal L. Schwartz)
Re: Logging time on SUnix (Greg Ward)
Re: Looking for a perl/cgi programmer who can maintain raj@NOSPAMnetpromote.com
MIME attachements. General questions. <jabbott@dingo.smig.net>
MS/IIS4 and custom errors with a perl script <Thierry.Masson@belgium-mail.com>
Re: Need to stress test a webserver <frogsmock@my-dejanews.com>
Newbie : bash doesn't want to run my script ! <fichou@club-internet.fr>
Re: Newbie : bash doesn't want to run my script ! (Steve Linberg)
Re: Newbie : bash doesn't want to run my script ! <fichou@club-internet.fr>
Re: outputting the day? (Greg Ward)
Re: Passing data during runtime.... <avm@atos.be>
Re: Passing data during runtime.... <avm@atos.be>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Feb 1999 17:12:30 GMT
From: emorris@qualcomm.com_NO_SPAM_PLEASE (Ed Morris)
Subject: Re: Anonymous subs, closure, and packages
Message-Id: <7b6klu$59s$1@thefuture.qualcomm.com>
In article <919995923.9115@thrush.omix.com>, zenin@bawdycaste.org says...
>
>[posted & mailed]
>
>Ed Morris <emorris@qualcomm.com> wrote:
>: I have a module called junk.pm, as follows:
> >snip<
>: This results in Hello being printed twice, as expected (it is printed
>: once directly from the test subroutine, and once from the anonymous
>: subroutine reference $junk).
>:
>: However, when I remove the line in test that prints it directly
>: (this line is commented REMOVE above), strange things happen. Hello
>: is then not even printed by the anonymous sub reference; instead, I
>: get the error message "Use of uninitialized value at junk.pm line 11."
>:
>: Is this behavior correct??
>: I would appreciate an explanation.
>
> This works fine on my system runnint 5.00404. Please include the
> full output from the command 'perl -V' to make sure this isn't an
> old bug. Thanks.
>
Here it is. Hope you can figure this out.
Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
Platform:
osname=solaris, osver=2.4, archname=sun4-solaris
uname='sunos liferaft 5.4 generic_101945-10 sun4m sparc '
hint=previous, useposix=true, d_sigaction=define
Compiler:
cc='/pkg/SUNWspro/bin/cc', optimize='-O', gccversion=
cppflags=''
ccflags =''
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Linker and Libraries:
ld='/pkg/SUNWspro/bin/cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags='-Kpic', lddlflags='-G -L/usr/local/lib'
@INC: /pkg/perl5/lib/sun4-solaris/5.003 /pkg/perl5/lib
/pkg/perl5/lib/site_perl/sun4-solaris /pkg/perl5/lib/site_perl .
Thanks,
Ed
------------------------------
Date: 26 Feb 1999 17:20:16 GMT
From: emorris@qualcomm.com_NO_SPAM_PLEASE (Ed Morris)
Subject: Re: Anonymous subs, closure, and packages
Message-Id: <7b6l4g$5i0$1@thefuture.qualcomm.com>
In article <919995923.9115@thrush.omix.com>, zenin@bawdycaste.org says...
>
> This works fine on my system runnint 5.00404. Please include the
> full output from the command 'perl -V' to make sure this isn't an
> old bug. Thanks.
>
Here it is. Hope you can figure this out.
Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
Platform:
osname=solaris, osver=2.4, archname=sun4-solaris
uname='sunos liferaft 5.4 generic_101945-10 sun4m sparc '
hint=previous, useposix=true, d_sigaction=define
Compiler:
cc='/pkg/SUNWspro/bin/cc', optimize='-O', gccversion=
cppflags=''
ccflags =''
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Linker and Libraries:
ld='/pkg/SUNWspro/bin/cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags='-Kpic', lddlflags='-G -L/usr/local/lib'
@INC: /pkg/perl5/lib/sun4-solaris/5.003 /pkg/perl5/lib
/pkg/perl5/lib/site_perl/sun4-solaris /pkg/perl5/lib/site_perl .
Thanks,
Ed
------------------------------
Date: 26 Feb 1999 17:57:12 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Anonymous subs, closure, and packages
Message-Id: <920051798.726515@thrush.omix.com>
Ed Morris <emorris@qualcomm.com_NO_SPAM_PLEASE> wrote:
> Here it is. Hope you can figure this out.
>
> Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Eg, version 5.003, which is both very old (1996) and very buggy.
The current release is 5.00502.
This is also infact, your problem. Here are my test results:
$ perl5.003 -w -Mjunk -e test
Use of uninitialized value at junk.pm line 11.
$ perl5.00404 -w -Mjunk -e test
Hello
$ perl5.00502 -w -Mjunk -e test
Hello
Upgrading to at least 5.00404 is a must and won't likely break
anything. -Moving to 5.005xx can cause problems so I wouldn't
recommend it unless you know you don't have any old code that
will be affected.
HTH
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Fri, 26 Feb 1999 16:46:38 GMT
From: psitko@my-dejanews.com
Subject: ascii values in Perl
Message-Id: <7b6j5a$eet$1@nnrp1.dejanews.com>
How do I refer to an ascii value for a character in Perl? I would like to be
able to do this in both a regular expression and just in comparing substrings.
Is there some sort of escape sequence to use.
For instance I'd like to be able to see if a substring of length one is a
character with a particular numerical ascii value. How would I do that. I
haven' t had any luck with the documentation and I'm sure I'm just looking in
the wrong places.
Thank you,
Paul Sitko
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 26 Feb 1999 18:42:58 +0100
From: Arnauld Van Muysewinkel <avm@atos.be>
To: psitko@my-dejanews.com
Subject: Re: ascii values in Perl
Message-Id: <36D6DD22.3DE2AF9D@atos.be>
psitko@my-dejanews.com wrote:
> How do I refer to an ascii value for a character in Perl? I would like to be
> able to do this in both a regular expression and just in comparing substrings.
> Is there some sort of escape sequence to use.
>
> For instance I'd like to be able to see if a substring of length one is a
> character with a particular numerical ascii value. How would I do that. I
> haven' t had any luck with the documentation and I'm sure I'm just looking in
> the wrong places.
I don't know exactly what you want to do.
* Either it is the 'ord' function that you need.
ord EXPR
Returns the ASCII value of the first character of EXPR.
* You can also use 'chr' to produce a character of a particular ASCII value
chr EXPR
Returns the character represented by the decimal value EXPR.
* Or you can use "\xZZ" which returns the character represented by the hexadecimal
value ZZ
or "\0ZZ" which returns the character represented by the octal value ZZ
> Thank you,
>
> Paul Sitko
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
-- Arnauld Van Muysewinkel
Atos SA [ http://www.atos.be ]
------------------------------
Date: Fri, 26 Feb 1999 12:05:47 -0700
From: parliman@lanl.gov (Bart Parliman)
Subject: backticks & system() wierdness
Message-Id: <parliman-2602991205480001@bluto.lanl.gov>
I've got several long running perl scripts (daemons) that seem to exhibit
strange behavior when using system() and backticks. For example there are
lines in the code that look something like this.
$output = `command`;
if ($?) {
... assume command failed...
}
Initially, the scripts run fine and many backtickish commands are executed
properly. After a while the backticks start to always return a non-zero
exit code even if the command works fine and generates correct output
(where it returns -1).
I've tried to replace the backticks with system(), something like this...
$rc = system("command >tmpfile 2>&1");
... but to no avail, I still get -1.
I *think* I tried to get this working by open()ing a pipe, but that it
produced the same results.
I've finally resorted to rolling my own "backticks" type call by using
fork/exec and retrieving the error from SIGCHLD with 'wait'. This works
ok, the proper exit code is returned, but I'd like to use backticks
instead. Note: I'm exec'ing with the same type of string shown above in
the system() call, so I'm *assuming* that /bin/sh is getting exec'ed and
returning the proper exit code.
Has anyone else seen this? FWIW, I'm on AIX 4.2.1 and am using perl 5.005_2.
Thanks.
--
Bart Parliman -- parliman@lanl.gov -- Los Alamos National Lab
------------------------------
Date: 26 Feb 1999 16:03:47 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Confused: Which Win95 perl to download?
Message-Id: <7b6gl3$khk$1@solti3.sdm.de>
In article <7b6fbe$atp$1@nnrp1.dejanews.com>, dturley@pobox.com wrote:
> In article <7b69ak$ibi$1@camel19.mindspring.com>,
> "Allan M. Due" <Allan@due.net> wrote:
> > I was not trying to cast aspersions on your skills :-)
> It very well could be my skills, or lack thereof. :-) But I think it's got
> more to do with the broken shell provided by win95. I've tried many times to
> get it to work to no avail. I've asked/posted around to various experts, and
> have never found anyone who actually has done it. (Of course, they may be
> hiding and not want anyone to know they spent the time with such an OS. :-)
I never used Win95 myself (I use NT when I have to), but it is known that
the shell (DOS box) of Win95 isn't good enough for certain things (which
the NT shell supports), like compiling additional Perl modules.
You should try ActiveState's port (for example from O'Reilly's "Win32
Perl Resource Kit") of Perl 5.005 which is a binary distribution.
This is the latest stable release of Perl.
Many modules accompany this distribution in precompiled form which you
can install using ActiveState's "PPM" tool (also included).
Or try the port of Perl 5.004 from Gurusamy Sarathy, which is also a
binary distribution and which contains many modules in precompiled and
preinstalled form (no need for manual installation).
This port is known to be extremely reliable and stable.
See http://www.perl.com/CPAN/authors/id/GSAR/perl5.00402-bindist04-bc.tar.gz
or http://www.engelschall.com/u/sb/download/pkg/perl5.00402-bindist04-bc.tar.gz
Hope this helps.
Regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software
http://www.perl.com/CPAN/authors/id/STBEY/ for Download)
New: Build'n'Play 2.1.0 (all-purpose Unix batch installation tool)
http://www.oreilly.de/catalog/perlmodger/bnp.html
------------------------------
Date: Fri, 26 Feb 1999 10:08:22 -0800
From: "Gala Grant" <gala@sonic.net>
Subject: database help
Message-Id: <7b6nrg$qmu$1@ultra.sonic.net>
I have been trying to do some work with databases and have found the info in
the perl books to be lacking. They seem to assume I have a working
knowledge of databases already, which I don't. I was wondering if anyone
could point me to some good info on databases. I need to know the details
of assigning values etc. I already understand how to access them once they
are in the database.
Thanks,
Gala Grant
gala@sonic.net
------------------------------
Date: Fri, 26 Feb 1999 14:38:01 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: database help
Message-Id: <linberg-2602991438010001@ltl1.literacy.upenn.edu>
In article <7b6nrg$qmu$1@ultra.sonic.net>, "Gala Grant" <gala@sonic.net> wrote:
> I was wondering if anyone
> could point me to some good info on databases. I need to know the details
> of assigning values etc. I already understand how to access them once they
> are in the database.
Um, the database section of your bookstore? Seriously, there are zillions
of books out there. If you're talking about SQL databases (as you
probably are), there are many beginners' guides. Find one that that
matches the system you're using. It's hard to give specific pointers
without more details of your system, and what you're trying to do with it.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Fri, 26 Feb 1999 17:50:17 GMT
From: mariita@my-dejanews.com
Subject: Email from Perl on Windows 95
Message-Id: <7b6msl$i5g$1@nnrp1.dejanews.com>
I am trying to configure junkmail.pl, which I found in the CPAN Archive, to
work on a Windows 95 platform. Does anybody know the best way to go about
this? Would it be better to use the Net::SMTP module?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 26 Feb 1999 08:58:54 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 6.21: What's wrong with using grep or map in a void context?
Message-Id: <36d6c4be@csnews>
(This excerpt from perlfaq6 - Regexps
($Revision: 1.25 $, $Date: 1999/01/08 04:50:47 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq6.html
if your negligent system adminstrator has been remiss in his duties.)
What's wrong with using grep or map in a void context?
Both grep and map build a return list, regardless of their context. This
means you're making Perl go to the trouble of building up a return list
that you then just ignore. That's no way to treat a programming
language, you insensitive scoundrel!
--
Even if you do learn to speak correct English, whom are you going to
speak it to?
--Clarence Darrow
------------------------------
Date: 26 Feb 1999 11:29:00 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 6.22: How can I match strings with multibyte characters?
Message-Id: <36d6e7ec@csnews>
(This excerpt from perlfaq6 - Regexps
($Revision: 1.25 $, $Date: 1999/01/08 04:50:47 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq6.html
if your negligent system adminstrator has been remiss in his duties.)
How can I match strings with multibyte characters?
This is hard, and there's no good way. Perl does not directly support
wide characters. It pretends that a byte and a character are synonymous.
The following set of approaches was offered by Jeffrey Friedl, whose
article in issue #5 of The Perl Journal talks about this very matter.
Let's suppose you have some weird Martian encoding where pairs of ASCII
uppercase letters encode single Martian letters (i.e. the two bytes "CV"
make a single Martian letter, as do the two bytes "SG", "VS", "XX",
etc.). Other bytes represent single characters, just like ASCII.
So, the string of Martian "I am CVSGXX!" uses 12 bytes to encode the
nine characters 'I', ' ', 'a', 'm', ' ', 'CV', 'SG', 'XX', '!'.
Now, say you want to search for the single character `/GX/'. Perl
doesn't know about Martian, so it'll find the two bytes "GX" in the "I
am CVSGXX!" string, even though that character isn't there: it just
looks like it is because "SG" is next to "XX", but there's no real "GX".
This is a big problem.
Here are a few ways, all painful, to deal with it:
$martian =~ s/([A-Z][A-Z])/ $1 /g; # Make sure adjacent ``martian'' bytes
# are no longer adjacent.
print "found GX!\n" if $martian =~ /GX/;
Or like this:
@chars = $martian =~ m/([A-Z][A-Z]|[^A-Z])/g;
# above is conceptually similar to: @chars = $text =~ m/(.)/g;
#
foreach $char (@chars) {
print "found GX!\n", last if $char eq 'GX';
}
Or like this:
while ($martian =~ m/\G([A-Z][A-Z]|.)/gs) { # \G probably unneeded
print "found GX!\n", last if $1 eq 'GX';
}
Or like this:
die "sorry, Perl doesn't (yet) have Martian support )-:\n";
There are many double- (and multi-) byte encodings commonly used these
days. Some versions of these have 1-, 2-, 3-, and 4-byte characters, all
mixed.
--
In general, if you think something isn't in Perl, try it out, because it
usually is. :-)
--Larry Wall in <1991Jul31.174523.9447@netlabs.com>
------------------------------
Date: Fri, 26 Feb 1999 20:38:15 GMT
From: duverm@hotmail.com
Subject: garbage characters after html from cgi?
Message-Id: <7b70nm$rgp$1@nnrp1.dejanews.com>
Has anyone used some sort of script that generates html and noticed garbage
characters at the end of the web document? I get one random character at the
bottom of my html document. It doesn't show up on the view -> source, but it
does on screen and in printouts.?
My script is a Perl script that hits an Oracle database. But I don't think
there is any problems with that. I get all of the results I want, except for
that character at the bottom left of my screen.?
-Mark D.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 26 Feb 1999 15:55:32 GMT
From: trinity@bnr.ca (Seshu Madhavapeddy)
Subject: Re: Getting user ID and password in perl script
Message-Id: <7b6g5k$8f1$1@crchh14.us.nortel.com>
Thanx for the info. But this does not seem to work. Earlier, I
was trying getting the environment variable 'REMOTE_USER' which
used to return nothing. The method 'remote_user' also returns
nothing. Here is my code:
use CGI;
$query=new CGI;
$userid = $query->remote_user();
print "UserID:$userid\n";
Is ther anything wrong with this?
- Mohan
Tony Curtis (Tony.Curtis+usenet@vcpc.univie.ac.at) wrote:
: Re: Getting user ID and password in perl script,
: Seshu <trinity@bnr.ca> said:
: Seshu> I am using O'Reilley web server on Windows
: Seshu> 95. When users login the ID and password are
: Seshu> entered in a dialog box. I need to get the ID
: Seshu> and password in a perl script for
: Seshu> validation. How do I do this
: I presume you mean the dialog generated by the
: browser software? So it's an HTTP challenge
: user/password you're talking about.
: You can get the user via CGI.pm's remote_user()
: method, but you can't get the password.
: hth
: tony
: --
: Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
: Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
: "You see? You see? Your stupid minds! | private email:
: Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Fri, 26 Feb 1999 20:22:06 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How can I write to an unpadded format field?
Message-Id: <F7s38u.KG0@world.std.com>
chrisw2679@my-dejanews.com writes:
>The trouble is I'm getting "Dear Joe Blow ," with the padded spaces in there
>to fill up the <<< markers.
Perl's format feature is all about creating fixed length reports. If
that isn't what you need, you might want to look into simple variable
interpolation, and maybe here-docs for readability.
>Dear @<<<<<<<<<<<
>$name ,
Thats close. If you say:
Dear @<<<<<<<<<<<
"$name,"
then perl evaluates the double quoted string and puts the result into
the field. (Still padded with spaces, but the padding comes after the
comma.)
--
Andrew Langmead
------------------------------
Date: 26 Feb 1999 09:05:53 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: IO::File <$fh> vs $fh->getline
Message-Id: <m11zjdw0we.fsf@halfdome.holdit.com>
>>>>> "Uri" == Uri Guttman <uri@ibnets.com> writes:
Uri> <rant>
Uri> this is one reason (of many) why i don't like to assign to my statements
Uri> (except for @_). i never liked it in c either. declarations and
Uri> assignments should be separate statements.
Uri> </rant>
Actually, there's no such thing as a "my statement". The "my" and
"local" keywords are prefixes to any lvalue, anywhere, and do not
change the context or perform any other function other than mark the
lvalue as lexical or temporary, respectively.
substr(my $x = "Hello, world!", 0, 5) = my $y = "Goodbye"; print $x;
package my; print my my my my my my $sharona = "Just another Perl hacker,";
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 26 Feb 1999 18:00:27 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: Logging time on SUnix
Message-Id: <7b6nfr$bv5$4@news0-alterdial.uu.net>
Shapeshifter <tldowney@newstand.syr.edu> wrote:
> I have an account on our school Unix system. Does anyone know of a method
> of logging time spent on a Unix system throught Perl? I'd like to be able
> to see my total time online for the day, week, and month. It's a
> glorification of the "last" command, essentially. If you have any ideas,
> please let me know!
Well, you already know about "last" -- so why not use it? The easiest
way would be to write a one-pass Perl script that parses the output of
"last", tallies up your logins by date/time, and prints the totals.
That's exactly the sort of thing Perl was designed for.
Anything more ambitious -- eg. update a database every time you
login/logout -- would essentially duplicate what last does, and be a lot
more bug-prone.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Fri, 26 Feb 1999 16:14:20 GMT
From: raj@NOSPAMnetpromote.com
Subject: Re: Looking for a perl/cgi programmer who can maintain a meta search engine
Message-Id: <36d6c8b4.54728466@news>
You're hired if the price is right and you can maintain it.
>
>let's suppose you found one. what would you say to that person?
>
>--
>brian d foy
>CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 26 Feb 1999 16:36:41 +0000
From: abbott in Northfield <jabbott@dingo.smig.net>
Subject: MIME attachements. General questions.
Message-Id: <36D6CD99.59468465@dingo.smig.net>
Hello,
I have written (sort of -- it only sort of works :-) a perl program that
is attached to a sendmail pipe. The way it works is this; I have setup
quite a number of msql databases. I have a certain number of people
that are responsible for updating the data. The people maintain their
data in excel spread sheets. What I have them do is save the
spreadsheet as a .csv file and email attach it to
database@server.etc.org.
The part that does not work is I can't seem to figure out how to
determin the file name of the attached file using MIME tools. I have
tried every possible combination I could figure out from the
documention. Has anyone gotten this module to work this way?
#!/usr/bin/perl
use MIME::Parser;
$mailprog = '/usr/sbin/sendmail';
$TMPpath ="/usr/home/jabbott/database/tmp";
my $parser = new MIME::Parser;
$parser->output_dir("$TMPpath");
$entity = $parser->read(\*STDIN) or die "couldn't parse MIME stream";
$from = $entity->get('From', 0);
$sub = $entity->get('Subject',0);
This does work as far as stripping off the attachment and I can make the
import run. What I am having people do now is put the file name in the
subject line but this is having an almost 80% failure rate as people
spell things wrong or make little errors. Generally it almost always
screws up. If I could tell for sure the filename of the attachment it
would cut this down dramatically.
As a secondary question, does anyone have any advice on where to look
for learning how to pass things to modules. Perhaps the documentation
is not that bad and I just can't understand it.
--ja
------------------------------
Date: 26 Feb 99 19:04:52 GMT
From: "Thierry Masson" <Thierry.Masson@belgium-mail.com>
Subject: MS/IIS4 and custom errors with a perl script
Message-Id: <01be61ba$98b2f970$8663fb96@nohw3835>
Hello,
On a Apache/Unix server (SGI IRIX 6.5), I trap the HTML ERROR 404 to a perl
script.
Here is a simple Perl Script :
print "HTTP/1.0 200 OK\r\n" if $ENV{PERLXS} eq "PerlIS" ; # For MS/IIS
web server
print "Content-type: text/html\n\n" ;
while(($key,$val)=each %ENV) {
print "$key=$val<br>\n" ; }
When I ask for an non-existing page, I receive the env. variables. Among
them :
REQUEST_URI = /doc/non-existingpage.htm
HTTP_HOST = sysil.noh.be.solvay.com:8888
SCRIPT_FILENAME = /usr/local/apache/share/cgi-bin/printenv
SERVER_PORT = 8888
REMOTE_PORT = 1192
REMOTE_ADDR = 195.251.99.134
.... many others
With this behaviour, I can get the requested page (REQUEST_URI)
When I try the same thing on a MS/IIS4 server (Perl 5.003_07) using the
Customs errors (404 error is mapped to a URL=/cgi-bin/printenv), I only
have this single variable :
PERLXS=PerlIS
It sounds like the error code lauche the Perl script in another environment
space.
Thus anybody get an idea ?
exit ;
--
--------------------------------------------------------------
SOLVAY SA Thierry Masson
DIRECTION CENTRALE DES RECHERCHES Phone Line : 32-2-264 29 06
Rue de Ransbeek, 310 Fax Line : 32-2-264 30 61
B-1120 BRUSSELS (BELGIUM) mailto:thierry.masson@solvay.com
http://www.solvay.com
---------------------------------------------------------------
------------------------------
Date: Fri, 26 Feb 1999 16:21:26 GMT
From: Jim <frogsmock@my-dejanews.com>
Subject: Re: Need to stress test a webserver
Message-Id: <8D797333Dfrogsmockmydejanewsc@news.berkshire.net>
r.t. <rtait@interport.net> wrote in <7b4inc$jeo$1@autumn.news.rcn.net>:
> I need to start stress testing some webservers that I have built, now
> obviously I can go ahead and spend some time writing some
> "parallelizing" perl code using the LWP, but I figure someone already
> has done this - or something like it.
There's a crashme script in the "Mod Perl Developer's Mini Guide" that has
worked very well for me. It's at:
http://perl.apache.org/guide/performance.html#Tuning_with_crashme_script
Jim
------------------------------
Date: Fri, 26 Feb 1999 19:23:13 +0100
From: "Patrick Fichou" <fichou@club-internet.fr>
Subject: Newbie : bash doesn't want to run my script !
Message-Id: <7b6opb$ae2$1@front6.grolier.fr>
Hi,
I want to run a script file from bash. It maybe simple but doesn't seem to
work !
1/ I add this (first) line in my script :
#!/usr/bin/perl
2/ My PATH is correct (contains /usr/bin)
3/ Perl is in this directory
4/ I use Linux Redhat 5.2
Where I'm wrong ?
Thanx !
Patrick
------------------------------
Date: Fri, 26 Feb 1999 14:36:24 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Newbie : bash doesn't want to run my script !
Message-Id: <linberg-2602991436240001@ltl1.literacy.upenn.edu>
In article <7b6opb$ae2$1@front6.grolier.fr>, "Patrick Fichou"
<fichou@club-internet.fr> wrote:
> I want to run a script file from bash. It maybe simple but doesn't seem to
> work !
> Where I'm wrong ?
What happens when you try to run the script?
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Fri, 26 Feb 1999 21:05:47 +0100
From: "Patrick Fichou" <fichou@club-internet.fr>
Subject: Re: Newbie : bash doesn't want to run my script !
Message-Id: <7b6upl$r8k$1@front5.grolier.fr>
Hi,
Bash answers : unknown command os something like that...
Patrick
Steve Linberg a icrit dans le message ...
>In article <7b6opb$ae2$1@front6.grolier.fr>, "Patrick Fichou"
><fichou@club-internet.fr> wrote:
>
>> I want to run a script file from bash. It maybe simple but doesn't seem
to
>> work !
>> Where I'm wrong ?
>
>What happens when you try to run the script?
>
>--
>Steve Linberg, Systems Programmer &c.
>National Center on Adult Literacy, University of Pennsylvania
>email: <linberg@literacy.upenn.edu>
>WWW: <http://www.literacyonline.org>
------------------------------
Date: 26 Feb 1999 18:06:45 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: outputting the day?
Message-Id: <7b6nrl$bv5$5@news0-alterdial.uu.net>
dan <nospam-seallama@mailcity.com> wrote:
> is there a way to output what day it is? i used localtime(time) to get
> the date, month, and year, but i cant get the actual day. any pointers?
> thanks
RTFM: "perldoc -f localtime" reveals the following:
Converts a time as returned by the time function to a 9-
element array with the time analyzed for the local time
zone. Typically used as follows:
# 0 1 2 3 4 5 6 7 8
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
You have a lot of useful (and technically redundant) information about
the date and time, including the week day (0..6), month day
(1..{28,29,30,31}, depending on the month and year), and year day
(0..{364,365} depending on the year).
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Fri, 26 Feb 1999 19:27:59 +0100
From: Arnauld Van Muysewinkel <avm@atos.be>
To: "Wade T. Funk" <wfunk@dev.tivoli.com>
Subject: Re: Passing data during runtime....
Message-Id: <36D6E7AF.AD8ACC01@atos.be>
"Wade T. Funk" wrote:
> I have a script that runs as a large while loop. While in the loop
> I give commands to run other procedures in other files. I am trying
> to take a CGI approach to present a GUI for this. My question is,
> how do I pass data to this backgrounded script and get the results
> from the other procedures' output?
Try using pipes.
> If anyone can tell me how to use 'perldoc' I would also be much
> appreciative. I'm new to this stuff.
>
> Thanks,
>
> Wade
--
-- Arnauld Van Muysewinkel
Atos SA [ http://www.atos.be ]
------------------------------
Date: Fri, 26 Feb 1999 19:49:08 +0100
From: Arnauld Van Muysewinkel <avm@atos.be>
To: "Wade T. Funk" <wfunk@dev.tivoli.com>
Subject: Re: Passing data during runtime....
Message-Id: <36D6ECA4.D3FE3F63@atos.be>
"Wade T. Funk" wrote:
> My question is How? Where can I find explicit code examples?
>
> Wade
> -----Original Message-----
> From: Arnauld Van Muysewinkel <avm@atos.be>
> Newsgroups: comp.lang.perl.misc
> To: Wade T. Funk <wfunk@dev.tivoli.com>
> Date: Friday, February 26, 1999 12:27 PM
> Subject: Re: Passing data during runtime....
>
> >"Wade T. Funk" wrote:
> >
> >> I have a script that runs as a large while loop. While in the loop
> >> I give commands to run other procedures in other files. I am trying
> >> to take a CGI approach to present a GUI for this. My question is,
> >> how do I pass data to this backgrounded script and get the results
> >> from the other procedures' output?
> >
> >Try using pipes.
If you are on a UN*X platform, the following shell command creates a named
pipe :
mknod pathname p
Then you can write to the pipe with the following Perl code (in your CGI
script) :
open PIPE, ">pathname" or die "can't write to pathname : $!";
print PIPE ...;
and read from it (in you background process) :
open PIPE, "pathname" or die "can't read from pathname : $!";
while <PIPE> {
...
}
Please note that 'pathname' is a path name, you could need to include the
full directory path.
(Eg : /usr/local/my_app/var/my_pipe)
Another solution would be to use sockets.
>
> >
> >> If anyone can tell me how to use 'perldoc' I would also be much
> >> appreciative. I'm new to this stuff.
> >>
> >> Thanks,
> >>
> >> Wade
> >
> >--
> > -- Arnauld Van Muysewinkel
> >
> > Atos SA [ http://www.atos.be ]
> >
> >
> >
--
-- Arnauld Van Muysewinkel
Atos SA [ http://www.atos.be ]
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4984
**************************************