[12441] in Perl-Users-Digest
Perl-Users Digest, Issue: 6041 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 18 08:07:57 1999
Date: Fri, 18 Jun 99 05:00:27 -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 Fri, 18 Jun 1999 Volume: 8 Number: 6041
Today's topics:
Re: Afraid to ask about Y2K! (David Cantrell)
Re: Afraid to ask about Y2K! (David Cantrell)
Re: Afraid to ask about Y2K! (David Cantrell)
Re: Afraid to ask about Y2K! (Bart Lateur)
environnement vars & external program jmtth@my-deja.com
Re: Having trouble making this work... <marko.hoepken@sican.de>
Help regular expressions slegarre@ireste.fr
Re: Help regular expressions (Bart Lateur)
Re: Help regular expressions (Marcel Grunauer)
Re: Help regular expressions <marko.hoepken@sican.de>
HOWTO compare two arrays, an get the difference <tor@kmd.dk>
Re: HOWTO compare two arrays, an get the difference (Eric Bohlman)
Re: HOWTO compare two arrays, an get the difference (Marcel Grunauer)
Re: HOWTO compare two arrays, an get the difference <marko.hoepken@sican.de>
Re: Launch a New Browser Window <martin@adoma.se>
Losing referrer information when passing through a perl <jde222RemovethiS@iname.com>
Re: matinal musings and the madrugada (David Cantrell)
Re: matinal musings and the madrugada (Bart Lateur)
Re: Micro(in)posters (was: Afraid to ask about Y2K!) (David Cantrell)
Re: Mysterious segmentation fault in mod_perl <matt.sergeant@ericsson.com>
Re: odd autoincrement behavior ? <bill@fccj.org>
Re: odd autoincrement behavior ? (Bart Lateur)
Re: Online database <fty@utk.edu>
Re: Opening a remote file? (Marcel Grunauer)
Re: Perl "constructors" (David Cantrell)
Re: Perl & External Program jmtth@my-deja.com
Re: PERL programmer needed for contract job... <matt.sergeant@ericsson.com>
Re: PERL programmer needed for contract job... <rd.sp3@voxel.net>
Re: Perl scripts slows down servers? (Marcel Grunauer)
POD formating problem <pavel@asei.cz>
Re: Simple Questions <marko.hoepken@sican.de>
Re: sorting an array from 2nd element onwards <marko.hoepken@sican.de>
Source Control (Rjack2)
UNIX: ~name won't work on system() as expected <marko.hoepken@sican.de>
Re: Using cgi or servlets, now? (Marcel Grunauer)
Re: Using Perl on MS PWS <micooper@hpbidrfr.bbn.hp.com>
Using perlcc to compile a perl prog wilda1@my-deja.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 18 Jun 1999 10:24:12 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <376b1e24.164254465@news.insnet.net>
On Tue, 15 Jun 1999 18:58:26 -0700, "J|rgen Exner"
<juex@my-dejanews.com> said:
>Tom Christiansen <tchrist@mox.perl.com> wrote in message
>news:3766e8a3@cs.colorado.edu...
>
>> After 11:59:59pm comes 12:00:00midnight.
>
>Sorry, but after 11:59:59 comes lunch.
>Probably you meant to say after 23:59:59 comes 00:00:00.
He did - he just spelt it differently. Yes, 12-hr clocks suck, but he
DID specify PM.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 18 Jun 1999 10:36:54 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <376c1e91.164363822@news.insnet.net>
On 15 Jun 1999 20:32:18 -0700, Tom Christiansen <tchrist@mox.perl.com>
said:
>In comp.lang.perl.misc,
> "J|rgen Exner" <juex@my-dejanews.com> writes:
>
>:24:00 is widely used at least.
>
>That makes no sense. Either either seconds in a day run from 00:00:00
>through 23:59:59 and there is no 24:00:00, or else they run from 00:00:01
>through 24:00:00 and there is no 00:00:00.
So it's just as bad as 12am or 12pm then. And whether it makes sense
or not is irrelevant. The point is that it is claimed to be widely
used.
>:> After 11:59:59pm comes 12:00:00midnight.
>:
>:Sorry, but after 11:59:59 comes lunch.
>
>No sir. Read my stuff above, and more carefully this time.
>
>:Probably you meant to say after 23:59:59 comes 00:00:00.
>
>Nope. I said what I meant. We were speaking English here, not German.
You are speaking American English. In English English, we refer to
'4pm', 'half past four in the afternoon', but we say 16:30:42. My
reference source is the London Underground timetable and the clock on
every single desktop machine being used by our computer-illiterate
designers.
However, he should have spotted the pm.
>Here's one reference:
>
> If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), hour
> is restricted to run from 1 to 12, and `:minute' may be omitted
> (taken to be zero). `am' indicates the first half of the day,
> `pm' indicates the second half of the day. In this notation, 12
> is the predecessor of 1: midnight is `12am' while noon is `12pm'.
>-> (This is the zero-oriented interpretation of `12am' and `12pm', as
>-> opposed to the old tradition derived from Latin which uses `12am'
>-> for noon and `12pm' for midnight.)
Fascinating, but without saying where that reference comes from , it
is worthless.
>The point is that twelve o'clock noon and twelve o'clock midnight properly
>pertain to neither the period ante meridian nor the one post meridian.
>I, being apparently of the old school, was taught that 12am was noon,
To have 11:59am followed by 12am followed by 12:01pm and likewise at
midnight just does not make sense. Those Romans have got a lot to
answer for.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 18 Jun 1999 10:52:55 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <376f2409.165763735@news.insnet.net>
On 15 Jun 1999 17:59:40 -0700, Tom Christiansen <tchrist@mox.perl.com>
said:
> [courtesy cc of this posting mailed to cited author]
>
>In comp.lang.perl.misc,
> "J|rgen Exner" <juex@my-dejanews.com> writes:
>:And 12:00 of course means noon, it can't be midnight
>
>I'm sorry, but you're wrong. It's not your fault though, because
>you're probably not a native speaker of English.
But I am, and 12:00 IS noon; midnight IS 00:00. 'Period', as those on
t'other side of the Atlantic might say.
[snip reference to a 19th century bell]
I refer you to the current London Underground timetable, or to various
current TV listings. Ceefax page 601 is a good place to start.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 18 Jun 1999 11:20:40 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <376d2aed.2963588@news.skynet.be>
David Cantrell wrote:
>To have 11:59am followed by 12am followed by 12:01pm and likewise at
>midnight just does not make sense. Those Romans have got a lot to
>answer for.
It's not their fault! If I remember correctly from my old school
lessons, the Romans divided the DAY (sunrise till sunset) into 12 hours,
and the night into 4 equal parts (night watch periods) of approximately
3 hours each. That suggests that the length of an hour wasn't fixed all
through the year. And they didn't use "AM" and "PM", although this does
come from Latin.
Bart.
------------------------------
Date: Fri, 18 Jun 1999 09:01:48 GMT
From: jmtth@my-deja.com
Subject: environnement vars & external program
Message-Id: <7kd1tp$ck4$1@nnrp1.deja.com>
Hi,
Some questions about Perl :
In a script, I would like to set an environnement variable :
$ENV{TODAY.DATE}='isodate -date';
where isodate -date is an exe that returns a value. Is it the good way
to do this ?
Then, I would like to lauch two exe. In batch file, it's done like this
:
qfquery jscalendar.qf "Date: %TODAY.DATE%" result.txt
qf2env result.txt -object TODAY -dos > %TODAY.DATE%env.bat
How can I do this in Perl ? (I tried with system and exec statements
but failed).
Then, I would like to lauch a .bat file (His name depend on the value
of the environnement
variable TODAY.DATE) :
%TODAY.DATE%env.bat
How can I do this in Perl ?
Thanks.
JMTTH.
--
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 18 Jun 1999 13:07:58 +0200
From: Marko Hoepken <marko.hoepken@sican.de>
Subject: Re: Having trouble making this work...
Message-Id: <376A288E.BBA7F37F@sican.de>
Hi Mitch,
you put a lot in this questions, but I may give some usefull hints. I suppose you are workin on a unix system:
Problem of missing subdir:
The /foo dir may not exist or the rights are not set correctly?
-> Check this first, or a simple work around is to run mkdir this way:
system("mkdir -p $dir");
This option creates the path also if the leading path is not there!
It is also recommended to check always for returning value of a
system call like:
$ret=system("mkdir -p $dir");
And check $ret after going on with the script. Somtime stuff like this
may result in a strange behaviour.
Marko
Mitch wrote:
>
> }
------------------------------
Date: Fri, 18 Jun 1999 09:07:24 GMT
From: slegarre@ireste.fr
Subject: Help regular expressions
Message-Id: <7kd288$cmr$1@nnrp1.deja.com>
Hi,
I have got this string of character in a file/
125 Jean-Paul Gauthier 42 Avenue des Chqmps Elysee 75001 Paris
I want to make some tests with the first number: 125
I try this ER : /(\d*)\s*/ but it doesn't work.
Thanks for your help
Steven
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 18 Jun 1999 10:23:59 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Help regular expressions
Message-Id: <376b1c46.12442544@news.skynet.be>
slegarre@ireste.fr wrote:
>I have got this string of character in a file/
>
>125 Jean-Paul Gauthier 42 Avenue des Chqmps Elysee 75001 Paris
>
>I want to make some tests with the first number: 125
>
>I try this ER : /(\d*)\s*/ but it doesn't work.
Does this work? Test $1:
/(\d+)/;
If you want to extract more fields, such as name, street name and
number, postal code and city, this looks like it won't be easy to
solidify. It works for THIS string, though.
($id,$name,$number,$street,$zip,$city) =
/(\d+)\s+([a-zA-Z.\ -]+?)\s+
(\d+)\s+([a-zA-Z.\ -]+?)\s+
(\d+)\s+([a-zA-Z. -]+)/x;
Bart.
------------------------------
Date: Fri, 18 Jun 1999 10:20:09 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Help regular expressions
Message-Id: <376e1d20.3611823@enews.newsguy.com>
On Fri, 18 Jun 1999 09:07:24 GMT, slegarre@ireste.fr wrote:
>Hi,
>
>I have got this string of character in a file/
>
>125 Jean-Paul Gauthier 42 Avenue des Chqmps Elysee 75001 Paris
>
>I want to make some tests with the first number: 125
>
>I try this ER : /(\d*)\s*/ but it doesn't work.
Works for me...
#!/usr/bin/perl -w
use strict;
while (<DATA>) {
print $1 if /(\d*)\s*/;
}
__DATA__
125 Jean-Paul Gauthier 42 Avenue des Champs Elysee 75001 Paris
But you might prefer:
print $1 if /(\d+)/;
HTH
Marcel
------------------------------
Date: Fri, 18 Jun 1999 13:32:36 +0200
From: Marko Hoepken <marko.hoepken@sican.de>
Subject: Re: Help regular expressions
Message-Id: <376A2E54.909482B6@sican.de>
slegarre@ireste.fr wrote:
> Hi,
>
> I have got this string of character in a file/
>
> 125 Jean-Paul Gauthier 42 Avenue des Chqmps Elysee 75001 Paris
>
> I want to make some tests with the first number: 125
>
> I try this ER : /(\d*)\s*/ but it doesn't work.
Try this:
/^(\d+)\s+/; # matching at beginning and each one or more matches
$number=$1;
>
>
> Thanks for your help
>
> Steven
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Fri, 18 Jun 1999 11:23:24 +0200
From: "Torfinn Keringen" <tor@kmd.dk>
Subject: HOWTO compare two arrays, an get the difference
Message-Id: <7kd3ck$irh$1@miri.tele.dk>
Hy
I have @array1 @array2, both of them contains a few lines of text,
what I want is an @array3 containing the lines from @array1
that is missing in @array2
@array1 @array2
tom tom
brian brian
mike mike
suzie suz
tim
@array3
suzie
tim
Thanks
Torfinn Keringen
tor@kmd.dk
------------------------------
Date: Fri, 18 Jun 1999 09:42:51 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: HOWTO compare two arrays, an get the difference
Message-Id: <ebohlmanFDIoBF.M90@netcom.com>
Torfinn Keringen (tor@kmd.dk) wrote:
: I have @array1 @array2, both of them contains a few lines of text,
: what I want is an @array3 containing the lines from @array1
: that is missing in @array2
If you're willing to settle for @array3 containing the lines in *either*
@array1 or @array2 that are missing from the other, you could use the
sample code in perlfaq4 under "How do I compute the difference of two
arrays" (this is technically know as the symmetric difference).
If you really need an asymmetric difference, populate a hash with the
lines from @array2 as keys (any values will do) and then grep @array1
with the test being a lookup in the hash.
------------------------------
Date: Fri, 18 Jun 1999 09:43:25 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: HOWTO compare two arrays, an get the difference
Message-Id: <376a14a7.1442544@enews.newsguy.com>
On Fri, 18 Jun 1999 11:23:24 +0200, "Torfinn Keringen" <tor@kmd.dk>
wrote:
>Hy
>I have @array1 @array2, both of them contains a few lines of text,
>what I want is an @array3 containing the lines from @array1
> that is missing in @array2
perlfaq4: How do I compute the difference of two arrays? How do I
compute the intersection of two arrays?
HTH
Marcel
------------------------------
Date: Fri, 18 Jun 1999 13:37:30 +0200
From: Marko Hoepken <marko.hoepken@sican.de>
Subject: Re: HOWTO compare two arrays, an get the difference
Message-Id: <376A2F7A.E5493DA7@sican.de>
"Torfinn Keringen" wrote:
> Hy
> I have @array1 @array2, both of them contains a few lines of text,
> what I want is an @array3 containing the lines from @array1
> that is missing in @array2
>
> @array1 @array2
> tom tom
> brian brian
> mike mike
> suzie suz
> tim
>
> @array3
> suzie
> tim
>
> Thanks
> Torfinn Keringen
> tor@kmd.dk
Try this: (not tested)
foreach $list1 (@array1) { # every entry of array1
if (! grep (/^$list1$/,@array2)) { # if the grep fails, the entry will be pushed
push (@array3,$list1);
}
}
Marko Hoepken
------------------------------
Date: Fri, 18 Jun 1999 12:55:27 +0100
From: "Martin Quensel" <martin@adoma.se>
Subject: Re: Launch a New Browser Window
Message-Id: <7kd9ok$6t6$1@cubacola.tninet.se>
Lawrence Ng skrev i meddelandet <7kcu0c$ji5$1@nuscc.nus.edu.sg>...
>How do I launch a new browser window on the client side to show him another
>web page using PERL. I still want my homepage to be open.
That has nothing to do with perl.
You cant send some magick weird infrared signal, or something, from your
perlscript that opens a window in the client browser.
You have to open the window first.
Most people use javascript for this.
and what that has to do with perl beats me.
Maybee you should try and get a general understanding of what things can,
and can't do.
For instance, a CGI program, cant execute things on your computer, (unless
you are on the server)
Like shutting it down, starting some programs, make it do into DOS, and
execute "deltree windows".
And it cant automagically open up a new window in your browser either.
A javascript can open windows in your browser.
Its very simple really. genneraly you can say.
A program on your computer, can do things on your computer.
A program on someone elses computer, can do things on that computer.
When you download a javascript, it is your computer that runs the program,
thus, it can do things on your computer.
Best Regards
Martin Quensel
------------------------------
Date: Fri, 18 Jun 99 10:42:25 GMT
From: "Euro Jake" <jde222RemovethiS@iname.com>
Subject: Losing referrer information when passing through a perl script...?
Message-Id: <7kd7g9$mbf$1@news3.Belgium.EU.net>
Hello all,
Through javascript, Im trying to use document.referrer to track where a
visitor came from on my site. Everything works fine until I have a password
access handled by a perl script. Once passed the perl generated html page,
the document.referrer info seems blank...
Most certainly im overlooking a detail...
Anyone give me a hand?
Thanks in advance
--
Euro Jake
>RemovethiS< in next line...
Anti spam email jde222RemovethiS@iname.com
------------------------------
Date: Fri, 18 Jun 1999 10:41:43 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: matinal musings and the madrugada
Message-Id: <376d2207.165249526@news.insnet.net>
On Thu, 17 Jun 1999 14:46:24 -0400, Greg Bartels <gbartels@xli.com>
said:
>course, the Marine Corps always dated their documents YY/MM/DD
>(which was a pain in the butt to unlearn in civilian life)
>so I dont know that they're the leaders in time standards.
Makes it nice n' easy to sort by date in a language which doesn't
support a Date type (see - back on topic!) which is a Good Thing.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 18 Jun 1999 11:14:30 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: matinal musings and the madrugada
Message-Id: <376b29cf.2678417@news.skynet.be>
David Cantrell wrote:
>>the Marine Corps always dated their documents YY/MM/DD
>Makes it nice n' easy to sort by date in a language which doesn't
>support a Date type (see - back on topic!) which is a Good Thing.
But yet it is a Y2K bug.
Bart.
------------------------------
Date: Fri, 18 Jun 1999 10:47:22 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Micro(in)posters (was: Afraid to ask about Y2K!)
Message-Id: <376e22c0.165434532@news.insnet.net>
On 15 Jun 1999 21:11:38 -0700, Tom Christiansen <tchrist@mox.perl.com>
said:
> [snip lots of header fields]
>
>Inquiring minds want to know: why do you appear to be a Microsoft person
>spoofing a Deja News person, or perhaps some random person spoofing being
>a Microsoft person spoofing a Deja News person?
He appears to be a Microsoft person who has chosen to receive replies
at his dejanews account. Am I equally suspicious in that I appear to
be posting from wirestation.co.uk but using NukeEmUp@ThePentagon.com
for my valid email address?
I am curious as to why you felt this to be an important issue in this
particular case.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 18 Jun 1999 10:23:34 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Mysterious segmentation fault in mod_perl
Message-Id: <376A1016.4B957FF7@ericsson.com>
hovinen@my-deja.com wrote:
>
> In article <376959D4.98DCAB47@mathworks.com>,
> Craig Ciquera <craig@mathworks.com> wrote:
> > What platform is all of this taking place on and what is the exact
> error
> > message
> > that you receive.
>
> It's Red Hat Linux 6.0. The error message, as viewed in Apache's
> error_log, is just the segmentation fault. The copies of Perl, Apache,
> and mod_perl were taken directly off of the installation CD for Red Hat
> Linux.
I'd get your own copy of perl, and install that instead. Red Hat's perls
are notoriously broken (5.x contained a test release of perl, I think
6.0's has threads enabled). You should probably also try compiling
mod_perl in statically - dynamic modules are still a bit flakey.
Good Luck,
Matt.
------------------------------
Date: Fri, 18 Jun 1999 06:56:03 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: odd autoincrement behavior ?
Message-Id: <376a2569.0@usenet.fccj.cc.fl.us>
Under MacPerl I get
# Missing $ on loop variable.
File 'Untitled #4'; Line 39
It doesn't like -
print "$_ : $hash{$_}\n" foreach sort keys %hash;
-Sneex- :]
______________________________________________________________________
Bill Jones Data Security Specialist http://www.fccj.org/cgi/mail?dss
------------------------------
Date: Fri, 18 Jun 1999 11:12:46 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: odd autoincrement behavior ?
Message-Id: <376a2956.2557417@news.skynet.be>
Bill Jones wrote:
>Under MacPerl I get
...
>It doesn't like -
>
> print "$_ : $hash{$_}\n" foreach sort keys %hash;
The latest MacPerl is still based upon Perl5.004. The syntax you're
trying to use is new for 5.005. Check it out, it won't like qr// either.
Bart.
------------------------------
Date: Fri, 18 Jun 1999 11:45:11 +0000
From: Jay Flahertry <fty@utk.edu>
Subject: Re: Online database
Message-Id: <376A3147.178DF719@utk.edu>
Neil wrote:
> I am looking for Online database options: actually just a flatfile
> database.
DBI and DBD::CSV
You can find these modules on CPAN
> On another topic, I am happy to report that I have ordered the Ram and
> am looking forward to learning some Perl. My learning strategy will be
> to read, program, and lurk in this group.
>
get Learning Perl and Programming Perl also
--
Take care of your shoes...jay
fty@utk.edu
------------------------------
Date: Fri, 18 Jun 1999 10:57:41 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Opening a remote file?
Message-Id: <376f25a5.5792469@enews.newsguy.com>
On 4 Jun 1999 16:25:45 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:
> [courtesy cc of this posting mailed to cited author]
>
>Cursed by Microsoft Outlook Express 4.72.3110.1 to torture
>comp.lang.perl.misc, "Thurley" <thurley@globalnet.co.uk> writes:
>
> +------------------------------------------------------------+
> | To my surprise, I found that |
> | "open(DATA,"http://www.somewhere.com/myfiles/data.html");" |
> | wouldn't work in my CGI. Does anyone know of an open |
> | function which knows what a URL or how to open a file on |
> | a remote server. I need this as my site is split accross |
> | servers. |
> +------------------------------------------------------------+
>
>Ha! Ha ha! Ha-ha ha-ha! Ha ha ha ha ha ha ha ha ha ha ha ha ha ha!
>
>Ok, I've gotten back on my chair again.
Maybe it should be possible to override the open command's
functionality to allow for that. Just imagine:
use CGI qw(:standard);
open(DATA, ">http://www.microsoft.com/index.asp">
print DATA header, start_html("Gone"),
"gone for demoronisation", end_html;
close(DATA);
Marcel
------------------------------
Date: Fri, 18 Jun 1999 10:17:57 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl "constructors"
Message-Id: <376a1cb6.163888208@news.insnet.net>
On Tue, 15 Jun 1999 11:13:53 GMT, armchair@my-deja.com said:
>I have never programmed in assembler.
Then you should do so, at least once. It is a useful exercise.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 18 Jun 1999 08:46:10 GMT
From: jmtth@my-deja.com
Subject: Re: Perl & External Program
Message-Id: <7kd10g$ccs$1@nnrp1.deja.com>
In article <nFW83.10620$Yr2.159340@news2.rdc1.on.home.com>,
"BJ" <bj@tech-center.com> wrote:
> I was wondering if anyone could tell me how to run an external .exe
(ie an
> application) from within Perl code. Also have the script wait for the
> application to close. Please respond VIA e-mail
>
> Thanks in advance
>
>
Hi,
I'm a beginer in Perl and I have the same problem.
I tried to call an exe from my script with system et exec statements ;
but I haven't got good results ! Try it and please send me back your
experience.
Thanks.
JMTTH. <jean-matthieu.guerin@sisro.com>
--
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 18 Jun 1999 10:17:05 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
To: Jeff Barringer <webmaster@kingsnake.com>
Subject: Re: PERL programmer needed for contract job...
Message-Id: <376A0E91.A33DD9A3@ericsson.com>
Jeff Barringer wrote:
>
> I need a PERL programmer who can build and implement
> a username password system into an existing matt's wwwboard script
> system. Will pay by hour or by job.
> The script needs to be built into the existing CGI script.
> Yes I have seen Get Scripts WWW protection feature and it won't
> work for what I need done. Please contact me ASAP
> by email or telephone at (512)990-1092
Why not just buy a copy of WebBoard from ORA? <shameless_plug>With v4.0
you get NNTP support too</shameless_plug>.
Matt.
------------------------------
Date: Fri, 18 Jun 1999 18:28:55 +0800
From: Raj Dutt <rd.sp3@voxel.net>
To: Jeff Barringer <webmaster@kingsnake.com>
Subject: Re: PERL programmer needed for contract job...
Message-Id: <376A1F67.59CF@voxel.net>
Hi Jeff
Just use .htaccess or an authentication scheme of your web server. It
shouldn't take more than 10 minutes or so to set up and will meet your
requirements.
Warm Regards,
Raj Dutt
Voxel Dot Net, Inc
http://hosting.voxel.net
Jeff Barringer wrote:
>
> I need a PERL programmer who can build and implement
> a username password system into an existing matt's wwwboard script
> system. Will pay by hour or by job.
> The script needs to be built into the existing CGI script.
> Yes I have seen Get Scripts WWW protection feature and it won't
> work for what I need done. Please contact me ASAP
> by email or telephone at (512)990-1092
>
> --
> Jeff Barringer
> kingsnake.com publications
> home of ...
> http://www.kingsnake.com
> http://www.fishhobbyist.com
> http://www.birdhobbyist.com
------------------------------
Date: Fri, 18 Jun 1999 09:47:32 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Perl scripts slows down servers?
Message-Id: <376c152f.1578329@enews.newsguy.com>
On Fri, 18 Jun 1999 10:42:02 +0200, "moi"
<toxid@rdtest.mm.atos-group.com> wrote:
>that's the question...
>
Everything you do on a server slows it down. I assume you mean, is it
better to create CGI programs in Java, Perl, or C++ or some other
language.
Perl is faster than Java, but slower than C++. It is, if well
programmed, more readable (and elegant!) than either. But then, what
response did you expect in a Perl newsgroup?
HTH
Marcel
------------------------------
Date: Fri, 18 Jun 1999 13:38:51 +0200
From: Pavel Hlavnicka <pavel@asei.cz>
Subject: POD formating problem
Message-Id: <376A2FCB.C4A849F8@asei.cz>
Hi all,
I'm learning Perl intensively, I hope I'll be able to give more answers
then questions soon. (Simple questions are answered to fast:-)
I use pod documentation. All work fine except =over paragraph.
When I include following:
=over
=item *First
First describing text
=item *Sec
Sec describing text
=item *Thrd
Sec
=back
and run pod2html:
pod2html --infile=builddb.pl --outfile=builddb.html --title="Test page"
List items are generated without paragraph indent between f.e. *First
desc. text and *Sec
It happens even if I copy a part of pod from FileHanlde.pm to my file.
It happens even if I run pod2html against FileHandle.pm, but
FileHandle.html from
Perl doc looks fine.
What's wrong?
Thanx
--
Pavel Hlavnicka
A.S.E.I. Ltd; Prague
tel.: +420 2 24106102
e-mail: pavel@asei.cz
------------------------------
Date: Fri, 18 Jun 1999 13:13:39 +0200
From: Marko Hoepken <marko.hoepken@sican.de>
Subject: Re: Simple Questions
Message-Id: <376A29E3.B4453760@sican.de>
rt_daemon@yahoo.com wrote:
> Greetings,
>
> 1. Is there a way to prevent the script being executed twice when
> someone's double click on the submit that makes the cgi script to write
> into a file.
>
> 2. How to take 3-4 lines from a certain file and then write it into
> another with a Perl Script ?
>
Here is the basic construct, check books about is, is a standart problem
open (IN,"< file1") || die "Can't open file1 for reading.\n";
open (OUT,"> file2") || die "Can't open file2 for writing.\n";
while (<IN>) { # read file1 line by line
if ( check here if this should be copied)
print OUT "$_"; # write lines into file2
}
close (IN);
close (OUT);
Marko Hoepken
>
>
> I really need help !!
>
> Daemon
> rt_daemon@yahoo.com
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Fri, 18 Jun 1999 13:24:48 +0200
From: Marko Hoepken <marko.hoepken@sican.de>
Subject: Re: sorting an array from 2nd element onwards
Message-Id: <376A2C80.EC2BAAD2@sican.de>
JQ wrote:
> Hi
>
> Is it possible to sort an array alphabetically only from the 2nd
> element onwards?
>
> For example:
>
> from:
> -----------------------------
> MONKEY
> Mouse
> Zebra
> Elephant
> Dog
> Cat
> -----------------------------
> result:
> -----------------------------
> MONKEY
> Cat
> Dog
> Elephant
> Mouse
> Zebra
> -----------------------------
>
> I know I could extract the first element (MONKEY) from the array, sort
> the array, then put MONKEY back in using "unshift", but is there a
> shorter and more efficient way to do this?
>
I don't think so, except write a subroutine, that is doint he stuff for you.
So you can do this in the rest of code in one line.
e.g.
sub mysort {
my (@data)=@_;
my $tmp;
$tmp=shift(@data);
$data=sort($data);
unshift (@data,$tmp);
return (@data);
}
call:
@array=mysort(@array);
By the way, isn't three lines short?
Try (not tested):
@array=shift(sort(unshift(@array))); # looks ugly but cooool (uses $_ to handle first element)
Marko Hoepken
>
> Thanks
>
> JQ
------------------------------
Date: 18 Jun 1999 11:56:12 GMT
From: rjack2@aol.com (Rjack2)
Subject: Source Control
Message-Id: <19990618075612.01399.00001553@ng-ch1.aol.com>
Folks,
I need a source control method for Perl and Java code. I work on PCs mainly,
but also do a little work on Macs and Unix.
Any inexpensive solutions here?
Thanks,
Robert R. Jackson "Are we the masters of our
Software For Humanity fate? Can we reach the
Rjack2@aol.com distance of our past?"
------------------------------
Date: Fri, 18 Jun 1999 11:47:46 +0200
From: Marko Hoepken <marko.hoepken@sican.de>
Subject: UNIX: ~name won't work on system() as expected
Message-Id: <376A15C2.13233B95@sican.de>
Hi,
currently I am developing a kind of workflow program in a Unix (Solais 2.7) enviroment.
Here I ran into an inconvenients by using full pathes instead of the shorter ~ operator.
Example:
# There is a user accout called 'hoepken'
# ~hoepken is in real e.g. /home/users/hoepken
# In a C-shell it can be accessed by e.h. cd ~hoepken or so...
# for a directory entry it may be 'ls ~hoepken/*'
# this can be done in Perl like:
$test="~hoepken/*";
@list=<'$test'>;
print "@list\n"; # works fine!
# now the problem cases:
chdir('$test'); # DOES NOT WORK, stays in same dir,
print "\n";
@list=<*>;
print "@list\n"; # not the dir of ~hoepken but the one where the script has been called
system "touch ~hoepken/test.txt"; # fails! Reason: ~hoepken will not be expanded (my guess)
system "touch /home/users/hoepken/test.txt"; # Works!
`touch ~hoepken/test.txt`; # fails! Reason: ~hoepken will not be expanded (my guess)
`touch /home/users/hoepken/test.txt`; # Works!
I would like to know, what the problem is (my fault??), or is there a easy way to
handle ~username in Perl instead parsing it by myself and expand it by building a yp-table or so....
Best regards to all,
Marko Hoepken, Germany
------------------------------
Date: Fri, 18 Jun 1999 09:45:15 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Using cgi or servlets, now?
Message-Id: <376b14e2.1501979@enews.newsguy.com>
On Fri, 18 Jun 1999 10:41:42 +0200, "moi"
<toxid@rdtest.mm.atos-group.com> wrote:
>that's the question...
>
Having a banana or flying to Jupiter, that's the question.
CGI is a protocol, it doesn't do anything by itself.
Servlets are sufficiently alien to me not to comment on, but I sure
know they're not protocols.
HTH
Marcel
------------------------------
Date: Fri, 18 Jun 1999 11:46:50 +0200
From: "Mike Cooper" <micooper@hpbidrfr.bbn.hp.com>
Subject: Re: Using Perl on MS PWS
Message-Id: <376a15c9@isoit370.bbn.hp.com>
Hi John,
Can't really be of much help, but it's something I need to do on NT soon.
Maybe Microsoft article Q150629 "Configuring and Testing a PERL Script with
IIS" would help. I've pasted the text below.
regards,
Mike Cooper
Q150629
SUMMARY
The following PERL script can be used to test for the proper installation
and execution of CGI scripts with Internet Information server.
MORE INFORMATION
Create a file with Notepad, and type the following lines of code. Save the
file in the scripts directory as Helloworld.pl.
print "HTTP/1.0 200 OK\n"; print "Content-Type: text/html\n\n";
print "<HTML>\n"; print "<HEAD>\n"; print "<TITLE>Hello World</TITLE>\n";
print "</HEAD>\n"; print "<BODY>\n"; print "<H4>Hello World</H4>\n"; print
"<P>\n"; print "Your IP Address is $ENV{REMOTE_ADDR}.\n"; print "<P>"; print
"<H5>Have a nice day</H5>\n"; print "</BODY>\n"; print "</HTML>\n";
Once you have created the file, you need to configure PERL to run securely
with Internet Information. Perl.exe should not be located in any of the
directories accessible by a user with a browser.
With a script mapping in the registry, you can place the Perl.exe outside of
the normal directory structure a user has access to.
To configure PERL script mapping
WARNING: Using Registry Editor incorrectly can cause serious, system-wide
problems that may require you to reinstall Windows NT to correct them.
Microsoft cannot guarantee that any problems resulting from the use of
Registry Editor can be solved. Use this tool at your own risk.
Start Regedt32.exe and open the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC
\Parameters\ScriptMap
Click Add Value from the Edit menu.
The Value Name is .pl
The Data type is REG_SZ.
The String value is <the full path to perl.exe>\perl.exe %s %s
NOTE: The "%s %s" is case sensitive. (e.g. "%S %S" will not work).
Restart the WWW service.
Now that the registry has been configured, you can test the PERL script with
your browser. Using the defaults directory structure with IIS, the URL would
be the following:
http://<Server Name>/scripts/helloworld.pl?
------------------------------
Date: Fri, 18 Jun 1999 10:36:46 GMT
From: wilda1@my-deja.com
Subject: Using perlcc to compile a perl prog
Message-Id: <7kd7fu$e28$1@nnrp1.deja.com>
I am currently having difficulties compiling a perl program I wrote
(prog.pl) using perlcc.
I have sucessfully compiled many other scripts using perlcc but in this
one I use my own modules. I have created and put these modules into a
custom libs directory, hence I can use the 'use' statement to include
the module. To allow me to do this I add in the top of the perl program
BEGIN
{
unshift(@INC, "/www/custom/libs");
}
This allows me to then simply say use MyModule; and hence I can use the
custom modules I have written.
When I run perlcc on this program everything seems to go fine, but when
I attempt to run the compiled program it cannot find the 'new' method
for my custom module. The actual error message is -
Can't locate object method "new" via package "MyModule" at prog.pl line
126.
Has anyone ever used perlcc with custom modules and come accross this
problem before?? Any help would be appreciated as I have been trying
everything...
Thanks, Andrew Wild.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
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 6041
**************************************