[22206] in Perl-Users-Digest
Perl-Users Digest, Issue: 4427 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 19 03:05:50 2003
Date: Sun, 19 Jan 2003 00:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 19 Jan 2003 Volume: 10 Number: 4427
Today's topics:
Re: A Good Perl Developing Enviroment <vze4cdy5@verizon.net>
Re: A Good Perl Developing Enviroment <eric.ehlers@btopenworld.com.nospam>
Anyone Using DBD::Chart or DBIx::Chart? <root@syrrx.com>
Re: Append a text at the top an existing file (Romuald Favre)
Re: DBI::rows reliability on SELECT statements (Ben Morrow)
fcntl() madness with C and perl (Dwayne Rightler)
Re: fcntl() madness with C and perl <goldbb2@earthlink.net>
got me foxed <david@morgmein.tk>
Re: got me foxed (Tad McClellan)
Re: got me foxed <bongie@gmx.net>
Re: got me foxed <wksmith@optonline.net>
Re: hard (Tad McClellan)
Re: hard <nobody@dev.null>
Re: hard <mgjv@tradingpost.com.au>
Re: hard (Jay Tilton)
Re: How can a SMTP mail be deleted from a Unix mailbox (Ben Morrow)
Inlining object methods via preprocessor for efficiency (Rich Wales)
parse email from /var/spool/mail/username <istink@real.bad.com>
Re: parse email from /var/spool/mail/username <istink@real.bad.com>
Re: perl hashes seems to slow down <goldbb2@earthlink.net>
Running a perl script as a windows 2000 service? <me@home.com>
Re: Running a perl script as a windows 2000 service? <vze4cdy5@verizon.net>
Re: Single Sign-On with XML and Perl <vze4cdy5@verizon.net>
Stemming words (was: Re: compare variable with next var <goldbb2@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 19 Jan 2003 05:18:57 GMT
From: "John Fraser" <vze4cdy5@verizon.net>
Subject: Re: A Good Perl Developing Enviroment
Message-Id: <5zqW9.14461$xx4.8725@nwrddc01.gnilink.net>
"A. Fuentes" <alvarof2@hotmail.com> wrote in message
news:iz4W9.43403$aG4.2586200@twister.austin.rr.com...
>
>
> Fellow Perl Netters:
>
> I have a newbie question:
>
> What would be a good Perl Developing Enviroment for
> managing and developing Perl projects?
> (Visual Developer Studio-like)
I use editpad on Windows and emacs on Unix. You can find editpad here:
http://www.codeguru.com/editctrl/editpad.shtml
------------------------------
Date: Sat, 18 Jan 2003 23:22:53 +0000 (UTC)
From: "eric" <eric.ehlers@btopenworld.com.nospam>
Subject: Re: A Good Perl Developing Enviroment
Message-Id: <b0cnkd$bnf$1@venus.btinternet.com>
hello
> What would be a good Perl Developing Enviroment for
> managing and developing Perl projects?
> (Visual Developer Studio-like)
active state's visual perl is a perl plug-in for visual developer studio. i
haven't tried it.
http://www.activestate.com/Products/Visual_Perl/
on windows i use open perl ide. it's primitive as IDEs go, but it's free
and it's more convenient than the dos command line.
http://open-perl-ide.sourceforge.net/
haven't found a perl ide for solaris.
regards
eric
------------------------------
Date: Sat, 18 Jan 2003 17:52:56 -0800
From: Rhugga <root@syrrx.com>
Subject: Anyone Using DBD::Chart or DBIx::Chart?
Message-Id: <3E2A04F8.4010703@syrrx.com>
I have hit a wall trying to get these to work. I am down to this error:
Undefined subroutine &main::dump_img called at ./cpuLoad.cgi line 47.
I have search google and other various boards and could not find
anything for 'dump_img' other than the CPAN documentation that comes
with the module. (which barely mentions the function call)
Thanks greatly for any help,
RG
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
------------------------------
Date: 18 Jan 2003 23:43:15 -0800
From: romuald_favre@hotmail.com (Romuald Favre)
Subject: Re: Append a text at the top an existing file
Message-Id: <34623cba.0301182343.232c2f8a@posting.google.com>
Thank you all for your answers.
Actually, I checked first of all the PerlFAQ5 "How do I change one
line in a file/delete a line in a file/insert a line in the middle of
a file/append to the beginning of a file?" and I implemented a
solution with its basic idea.
But I was still wondering if it wasn't a similar and as easy solution
as the appending at the end of a file (with the statement open
(FILE,'>> file.txt')).
Obviously it's not the case...
RF
Brian McCauley <nobull@mail.com> wrote in message news:<u9vg0oas95.fsf@wcl-l.bham.ac.uk>...
> romuald_favre@hotmail.com (Romuald Favre) writes:
>
> > Subject: Append a text at the top an existing file
>
> This is FAQ: "How do I [...] append to the beginning of a file?"
>
> > Thanks in advance for your help !
>
> If you are going to do anything "in advance" it sould be check the FAQ.
------------------------------
Date: Sun, 19 Jan 2003 00:25:47 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: DBI::rows reliability on SELECT statements
Message-Id: <b0crab$4qc$1@wisteria.csv.warwick.ac.uk>
Michael Budash <mbudash@sonic.net> wrote:
>In article <x7ptqu2s44.fsf@mail.sysarch.com>,
> Uri Guttman <uri@stemsystems.com> wrote:
>
>> well, dash those hopes. rows() is DBD dependent and you shouldn't rely
>> upon it if you want easier porting to any DB. i have dbi code that
>> uses a mysql dbd feature but it is isolated in a method that can be
>> replaced if needed for porting. you can choose nonstandard dbd stuff if
>> you know that you may have to deal with porting issues later.
>>
>> uri
>
>perldoc DBD::mysql makes no specific mention of how it handles the
>rows() method... so where does *that* leave me?
Reading perldoc DBI? I believe someone has already told you it gives an
alternative for SELECT queries.
One alternative method to get a row count for a
"SELECT" is to execute a "SELECT COUNT(*) FROM ..."
SQL statement with the same "..." as your query and
then fetch the row count from that.
Ben
------------------------------
Date: 18 Jan 2003 17:16:42 -0800
From: drightler@technicalogic.com (Dwayne Rightler)
Subject: fcntl() madness with C and perl
Message-Id: <c81ae143.0301181716.179a19cc@posting.google.com>
I have a C program that uses fcntl() to lock files, the following code
is a test program that does a lock, sleep, unlock:
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
int main()
{
struct flock lock;
int fd;
fd = open("a",O_WRONLY);
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 1;
lock.l_pid = 0;
printf("%d\n",fcntl(fd, F_SETLKW, &lock));
sleep(20);
lock.l_type = F_UNLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 1;
lock.l_pid = 0;
printf("%d\n",fcntl(fd, F_SETLKW, &lock));
close(fd);
return(0);
}
I would like to write a perl script to do the same locking so I wrote:
!/usr/bin/perl
use strict;
use Fcntl;
my($pack);
open(FILE,">a");
$pack = pack('s s l l l', &F_WRLCK, 0, 0, 1, 0);
print(fcntl(FILE, &F_SETLKW, $pack) . "\n");
sleep(20);
$pack = pack('s s l l l', &F_UNLCK, 0, 0, 1, 0);
print(fcntl(FILE, &F_SETLKW, $pack) . "\n");
close(FILE);
The two programs when run right after one another dont see each
other's lock, but when running two copies of the same program (either
program) they respect the lock. I imagine I have the perl syntax not
quite matched up to the C syntax. Any help would be appriciated.
------------------------------
Date: Sat, 18 Jan 2003 22:01:38 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: fcntl() madness with C and perl
Message-Id: <3E2A1512.465DE37@earthlink.net>
Dwayne Rightler wrote:
[snip stuff which does locking]
Your code (both C and perl versions) unlock the handle before closing.
You probably shouldn't be doing that, since in many situations, it
*introduces* a race condition that otherwise wouldn't be there. Just
close the handle, and it will unlock automatically.
> The two programs when run right after one another dont see each
> other's lock,
That's good! When one program finishes, it releases the lock, allowing
the next program to acquire it.
> but when running two copies of the same program (either program) they
> respect the lock.
That's good too.
Now, for the million dollar question: What happens if you try and run a
copy of one program at the exact same time as you are running a copy of
the other program?
> I imagine I have the perl syntax not quite matched up to the C syntax.
> Any help would be appriciated.
Hmm, everything *looks* about right. (Assuming that 'struct lock'
consists of two signed "short"s and three signed "long"s, as your pack
format implies, and that these 5 elements are, in order: type, whence,
start, len, pid).
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: Sun, 19 Jan 2003 01:05:07 +0000
From: David Sparkmunster <david@morgmein.tk>
Subject: got me foxed
Message-Id: <o1uj2v09vv88s6koe45hvq66btgnu5i1qe@4ax.com>
Hi
the perl below does what I want by taking input from a form and
writing to one of 6 text files.
When I hit the submit button on the form, however, an error page comes
up. If I close the error page and go back to the form page, it has
done the write perfectly well.
This is my first attempt at using perl and I'd very much appreciate
any feedback.
The perl is below, the page with form page is at http://io.dtnet.org
mucho grazias
david
=======================================================
#!/usr/bin/perl
use CGI qw(:standard);
$gigid = param("gig"); #get the parameters from the form user
$name = param("name");
$status = param("status");
@playerlist = readdata(); #read the list into playerlist array
@playerlist=grep(! /$name/,@playerlist); #playerlist minus the line
containing the name sent from the form, this line is added next
push(@playerlist,"$name $status"); #insert line of data according to
params from form
@playerlist = sort { $a cmp $b } @playerlist; # sort the list since
the changed item is added at the end of the list
chomp @playerlist;
writedata(@playerlist); #write the amended list to the appropriate
gig.txt file
###############################
sub readdata{
open(FP, "../$gigid.txt")|| die ("Couldn't open players name file -
please contact Jonathan Thorpe to report problem\n");
my(@playerlist)=<FP>;
chomp @playerlist;
close(FP);
return(@playerlist);
}
###############################
sub writedata{
my(@playerlist)=@_;
open(FP, ">../$gigid.txt")|| die ("Couldn't open players name file -
please contact Jonathan Thorpe to report problem\n");
foreach(@playerlist) {
print FP "$_\n";
}
#close(FP);
}
------------------------------------
David Thorpe
See my photo portfolio of royalty free pictures:
http://www.rebelartist.com/seller/dthorpe
See my theatre
The Surrey Stick Figure Theatre Of Death at:
http://www.c-cat.demon.co.uk/theatre/
------------------------------
Date: Sat, 18 Jan 2003 19:58:20 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: got me foxed
Message-Id: <slrnb2k1hs.8sd.tadmc@magna.augustmail.com>
David Sparkmunster <david@morgmein.tk> wrote:
> the perl below does what I want by taking input from a form and
> writing to one of 6 text files.
>
> When I hit the submit button on the form, however, an error page comes
> up.
What does it say?
Error messages are meant to help in debugging, so it is helpful
to have access to their exact text.
> If I close the error page and go back to the form page, it has
> done the write perfectly well.
>
> This is my first attempt at using perl and I'd very much appreciate
> any feedback.
Run the program from the command line rather than in a CGI environment.
If it works at the command line, but not under CGI, then you don't
have a Perl problem, the real problem is somewhere else.
>=======================================================
> #!/usr/bin/perl
Ask for some more help.
#!/usr/bin/perl
use strict;
use warnings;
> use CGI qw(:standard);
>
> $gigid = param("gig"); #get the parameters from the form user
> sub readdata{
>
> open(FP, "../$gigid.txt")|| die ("Couldn't open players name file -
> please contact Jonathan Thorpe to report problem\n");
Global variables are bad. You should pass $gigid as an argument instead.
Since $gigid came from a cracker (assumed) you better enable taint
checking before you get to production.
perldoc perlsec
for more info.
You should include the $! variable in your die() message. It contains
the reason why the open failed, such as "permission denied" or
"no such file".
> sub writedata{
>
> my(@playerlist)=@_;
>
> open(FP, ">../$gigid.txt")|| die ("Couldn't open players name file -
> please contact Jonathan Thorpe to report problem\n");
Since CGI programs are multitasking, you will also need to implement
file locking if you don't want the contents of $gigid.txt to
become corrupted.
perldoc -q "\block"
Have you looked in your server's error logs?
You might also be able to get insights into what went wrong if
you arrange to get better access to error messages:
perldoc -q CGI
"How can I get better error messages from a CGI program?"
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 19 Jan 2003 04:48:31 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: got me foxed
Message-Id: <3964192.062vadvOD0@nyoga.dubu.de>
David Sparkmunster wrote:
> When I hit the submit button on the form, however, an error page comes
> up. If I close the error page and go back to the form page, it has
> done the write perfectly well.
In addition to what Tad already said: I can't see where your script
will output anything back to the server. A CGI is expected to return
some data (a HTTP header and in most cases some HTML), and the user for
sure wants to see a result for his action.
Ciao,
Harald
--
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
People don't need faster computers. They just need to learn patience.
It's much cheaper, and it works for things besides computers.
-- Travis C. Hayes
------------------------------
Date: Sun, 19 Jan 2003 05:03:18 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: got me foxed
Message-Id: <qkqW9.269383$FT6.44876210@news4.srv.hcvlny.cv.net>
"David Sparkmunster" <david@morgmein.tk> wrote in message
news:o1uj2v09vv88s6koe45hvq66btgnu5i1qe@4ax.com...
> Hi
>
> the perl below does what I want by taking input from a form and
> writing to one of 6 text files.
>
> When I hit the submit button on the form, however, an error page comes
What does the error message say?
> up. If I close the error page and go back to the form page, it has
> done the write perfectly well.
I think you browser expects a page to display when it links to your CGI
page. Why not output a page which says that the file has been updated?
>
--snip--
Your are well on the way by using the CGI module.
Bill
------------------------------
Date: Sat, 18 Jan 2003 15:15:18 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: hard
Message-Id: <slrnb2jgv6.8bj.tadmc@magna.augustmail.com>
Jürgen Exner <jurgenex@hotmail.com> wrote:
> and it is hard
> to guess what the OP meant.
Hence the Subject header that was chosen.
Full circle. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 19 Jan 2003 00:11:04 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: hard
Message-Id: <3E29EC29.7080208@dev.null>
Abigail wrote:
> KT (kennedyel_5000@yahoo.com) wrote on MMMCDXXVII September MCMXCIII in
> <URL:news:6495f466.0301180044.7fa4eca3@posting.google.com>:
Your computer's clock is waaaaay off. That message was actually dated
XVIII January MMIII.
------------------------------
Date: Sun, 19 Jan 2003 12:13:15 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: hard
Message-Id: <slrnb2jutb.7m2.mgjv@martien.heliotrope.home>
On Sun, 19 Jan 2003 00:11:04 GMT,
Andras Malatinszky <nobody@dev.null> wrote:
>
>
> Abigail wrote:
>
>> KT (kennedyel_5000@yahoo.com) wrote on MMMCDXXVII September MCMXCIII in
>> <URL:news:6495f466.0301180044.7fa4eca3@posting.google.com>:
>
> Your computer's clock is waaaaay off. That message was actually dated
> XVIII January MMIII.
Look up the "September that never ended" with your favourite web search
engine.
Martien
--
|
Martien Verbruggen | For heaven's sake, don't TRY to be cynical.
| It's perfectly easy to be cynical.
|
------------------------------
Date: Sun, 19 Jan 2003 01:19:09 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: hard
Message-Id: <3e29fc3b.150442083@news.erols.com>
Andras Malatinszky <nobody@dev.null> wrote:
: Abigail wrote:
:
: > KT (kennedyel_5000@yahoo.com) wrote on MMMCDXXVII September MCMXCIII in
: > <URL:news:6495f466.0301180044.7fa4eca3@posting.google.com>:
:
: Your computer's clock is waaaaay off. That message was actually dated
: XVIII January MMIII.
http://www.tuxedo.org/~esr/jargon/html/entry/September-that-never-ended.html
------------------------------
Date: Sun, 19 Jan 2003 00:22:03 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: How can a SMTP mail be deleted from a Unix mailbox by a script?
Message-Id: <b0cr3b$4o1$1@wisteria.csv.warwick.ac.uk>
Markus.Elfring@web.de (Markus Elfring) wrote:
>Hallo,
>
>I want to continue the discussion about this topic that started with
>my request (http://groups.google.de/groups?selm=8utj4k%24cbi%241%40news.messer.de)
>on 2000-11-15.
>I thank all parties for their comments and suggestions.
>
>
>The term "SMTP mail" that I've chosen specifies a message according to
>the standard "RFC 822" (http://ietf.org/rfc/rfc0822.txt). This format
>can be send over the communication protocol "SMTP" and some others.
>
>Excerpt from the book "Programming Internet Email" - Chapter 4
>"MIME-compliant messages", Page 60:
>"...
>the simplest MIME-compliant message is just an RFC 822 simple text
>message with an added MIME-Version header.
>..."
>
>
>
>This request's subject is the deletion of messages in the file "mbox".
>1. Some programmes provide the prompt/command line as their
>programming interface.
>The deletion can be performed manually by typing the letter "d" with a
>following message number inside the programmes "mail". (This step can
>be performed by a script, too.)
>
>I encounter the difficulty to scroll through all exististing messages
>by a command to find the right number for the message that should be
>deleted. I am looking for an efficient algorithm.
>
>3. A method for the deletion seems to be missing. I come to a
>fundamental programming problem now.
>How can a piece be cut out from the file "mbox" that can be huge in
>size and that is accessed rapidly and perhaps without breaks while new
>messages are appended to the file end?
>(The programme "mailx" has got a built-in solution. I don't want to
>look at the source files.)
>
>3.1 I do not know yet how to put the ends of the gap together again.
>
>3.2 The file can always be written (without the deleted contents) to a
>new version. The updated version replaces the old one. Is this
>applicable if you think about speed?
>A problem detail is also to acquire a lock for the write access to
>update the file.
You may find http://www.jwz.org/doc/mailsum.html helpful.
Ben
------------------------------
Date: Sun, 19 Jan 2003 06:54:25 +0000 (UTC)
From: richw@richw.org (Rich Wales)
Subject: Inlining object methods via preprocessor for efficiency (!?)
Message-Id: <20030119060919.B20028.richw@jessejames.Stanford.EDU>
I wrote an object-oriented Perl program some time ago which needed
to run as fast as possible.
One speed problem I foresaw involved object methods. To give one
example, I had a class called "Ch", and one of the data elements
in a "Ch" was called "extra" (don't ask what it means, it doesn't
really matter here). The "extra" element got set up near the
start of the program and was thereafter supposed to be treated
as read-only.
The obvious Perl thing to do would have been to write a method
called "extra", something like this:
sub extra { my this = shift; this->{extra} }
and then write things like some_ch->extra() all through my
code. But the problem I saw with that approach was that I would
have been incurring the overhead of calling a function each and
every time I wanted to access the "extra" element of a "Ch" object.
So, instead, I tried setting up my original Perl source to be run
through the "cpp" preprocessor (via a custom filter script that
prevented ordinary comment lines from being mangled by "cpp";
again, please don't worry or ask about the gory details of this
right now). I did this preprocessing only once (via "make") and
saved the result to be run as often as needed later on.
One of the lines in my header file looked something like this:
#define chExtra(c) do { c->{extra} }
which allowed me to write things like chExtra(some_ch) in my
code, and they would be expanded inline without function calls.
(The "do" block around the macro was to prevent it from being
used as an lvalue, since I wanted the value to be read-only.)
While this technique worked, being forced to resort to "cpp" felt
inelegant, the required coding style was un-Perlish, and I would
really rather have done it some other way. Any suggestions?
Rich Wales richw@richw.org http://www.richw.org
------------------------------
Date: Sat, 18 Jan 2003 22:12:24 -0500
From: istink <istink@real.bad.com>
Subject: parse email from /var/spool/mail/username
Message-Id: <3E2A1798.41901D39@real.bad.com>
Anyone know what separates each message in the /var/spool/mail/username
file?
------------------------------
Date: Sat, 18 Jan 2003 22:18:12 -0500
From: istink <istink@real.bad.com>
Subject: Re: parse email from /var/spool/mail/username
Message-Id: <3E2A18F4.4955260D@real.bad.com>
istink wrote:
>
> Anyone know what separates each message in the /var/spool/mail/username
> file?
that is, I remember some module that does that.
------------------------------
Date: Sat, 18 Jan 2003 21:51:39 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: perl hashes seems to slow down
Message-Id: <3E2A12BB.C11D925E@earthlink.net>
ctcgag@hotmail.com wrote:
>
> Benjamin Goldberg <goldbb2@earthlink.net> wrote:
>
> > Given the slowness of tie()d variables, I've occasionally bypassed
> > tieing altogether, and done:
> >
> > my $db = SDBM_File->TIEHASH('filename', O_RDWR|O_CREAT, 0666);
> > my $x = $db->FETCH($key);
> > $db->STORE($key, $value);
> > undef $db;
> >
> > This is generally much faster, with the only drawback being that you
> > can't use $db in places where a hashref is expected... you can only
> > use it in places that "know" that it's an object.
>
> Couldn't you do
> my $db = tie %hash, 'SDBM_File', 'filename', O_RDWR|O_CREAT, 0666;
>
> Then use $db->*() where you are really concerned about speed, while
> still having the flexibility of using \%hash in legacy code that
> isn't used as intensively and you don't want to rewrite?
Hmm, I suppose you could ... I'll admit, though, that I've never
actually been in a situation where I both needed the speed of the
ordinary method calls, and the flexibility of \%hash for legacy code.
I just made my comment as a warning for others, and you've just shown a
workaround I hadn't thought of.
> Or does tieing cause some generalized slowdown, like $' and $` do
> for regexes?
Not that I know of.
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: Sun, 19 Jan 2003 01:53:50 GMT
From: "MG" <me@home.com>
Subject: Running a perl script as a windows 2000 service?
Message-Id: <OynW9.15612$o8.287859@twister.tampabay.rr.com>
not sure if this would be a windows post or a perl post but here goes:
I have some perl scripts that I want to initialize when my webserver starts
up. Unfortunately, Windows isn't like linux and I can't just add
./myscript.pl to a runlevel to make it run at startup. I have to manually
run it and unfortunatley I am stuck with a DOS box on my screen (is there
anything like the unix `&' postfix that will run it in the background?).
With my current method, if the computer reboots (as is common on windows
machines) and I'm not around the script will not run until I log in. It
also will not respawn if it crashed, like with a service. Hopefully someone
out there might have some clues as to how to do this (or if theres a utility
to do it for me!). Thanks.
- Joe
jbeckman.removeme@tampabay.rr.com
------------------------------
Date: Sun, 19 Jan 2003 05:15:04 GMT
From: "John Fraser" <vze4cdy5@verizon.net>
Subject: Re: Running a perl script as a windows 2000 service?
Message-Id: <svqW9.11323$V75.9454@nwrddc02.gnilink.net>
> I have some perl scripts that I want to initialize when my webserver
starts
> up. Unfortunately, Windows isn't like linux and I can't just add
> ./myscript.pl to a runlevel to make it run at startup. I have to manually
You should be able to launch it from the startup folder located on the
desktop from start/programs
I think you can also place in the registry at:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
> run it and unfortunatley I am stuck with a DOS box on my screen (is there
> anything like the unix `&' postfix that will run it in the background?).
Try using the following:
C:\start wperl myscript.pl
wperl is a perl interpreter that runs like a normal windows process, but
without any windows. Not sure if it comes with activestate or not, but its
a part of the core distro.
> - Joe
>
Cheers,
John
------------------------------
Date: Sun, 19 Jan 2003 05:28:34 GMT
From: "John Fraser" <vze4cdy5@verizon.net>
Subject: Re: Single Sign-On with XML and Perl
Message-Id: <6IqW9.11346$V75.9985@nwrddc02.gnilink.net>
> Most of us know that we can retrieve a cookie placed by a central
> auth-domain using a redirect back to the auth-server.
>
> My question to our group: Is it possible to use XML to query the
> auth-server, and let the auth-server query it's cookie without a physical,
> albeit brief, redirect?
While not a direct Perl question, it is an interesting one to pursue. If
you own a copy of "Programming Web Services in SOAP", there is an example
(chapter 7 I think) using SAML (Security Access Markup Language) to provide
and maintain authentication information. Not sure if this answers your
question, but it is something that most, if not all, all of the SSO
providers will be supplying if they don't already.
------------------------------
Date: Sun, 19 Jan 2003 01:25:19 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Stemming words (was: Re: compare variable with next variable ...)
Message-Id: <3E2A44CF.351E23CB@earthlink.net>
FMAS wrote:
>
> Hi Tina,
>
> I apologize if you get the impression that I don't think carefully
> about the advices given. I have spent so far many many hours trying to
> work out a solution, but I am not a programmer and I do this in my
> spare time when there is some. I probably make many basic mistakes.
>
> Many thanks to all of you for your suggestions.
>
> Let me give you a little bit more background. The script should help
> create terminology lists in a few languages. I know that creating a
> model to stem lexems is a task which takes a full team of computer
> linguists. But in my daily work it would already help to reduce an
> existing list of special terms (extracted from documentations with
> other tools) by taking a way the most frequent endings.
[snip]
> As you see it is not as easy as it seems. I guess the problem is to
> get 2 variables, one with the basic word which should occur first and
> another with as many variation of the first variable.
>
> Once this works I'll try to find a formula for as many words
> variations as possible.
How about this:
my %words;
while( <> ) {
my ($stem) = /(.*?)[emns]*\z/;
$words{lc $stem}{$stem} = " ";
}
print %$_, "\n" for values %words;
__END__
[untested]
If you could show us the output that you want produced from your input
file, then of course we might be able to write something better.
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4427
***************************************