[23005] in Perl-Users-Digest
Perl-Users Digest, Issue: 5225 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 15 11:05:49 2003
Date: Tue, 15 Jul 2003 08:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 15 Jul 2003 Volume: 10 Number: 5225
Today's topics:
Book on SSL programming with Perl? <jill_krugman@yahoo.com>
Re: calling system command as another user (bm)
Cleaning out a text file. (Avatar)
Re: Cleaning out a text file. <peter_wilson@mail.com>
Re: Cleaning out a text file. <tony_curtis32@yahoo.com>
Re: Cleaning out a text file. <uri@stemsystems.com>
Re: Cleaning out a text file. <jurgenex@hotmail.com>
Re: Cleaning out a text file. <abigail@abigail.nl>
Determine a child PID (Joey)
ERROR.. with regex!! <member31962@dbforums.com>
Re: ERROR.. with regex!! <abigail@abigail.nl>
Re: ERROR.. with regex!! news@roaima.freeserve.co.uk
Re: ERROR.. with regex!! (James E Keenan)
filehandle to variable problem <mathias@gms.lu>
Re: filehandle to variable problem (Greg Bacon)
Re: filehandle to variable problem <mathias@gms.lu>
Re: flock() and W95 <peter.dintelmann@dresdner-bank.com>
Re: flock() and W95 <noreply@gunnar.cc>
if-map vrs foreach-if (fatted)
Re: if-map vrs foreach-if <nanae@perusion.com>
Listing machine accounts & sids in an NT 4 domain? (Brian Duffy)
Re: Listing machine accounts & sids in an NT 4 domain? <peter_wilson@mail.com>
Re: Problem executing a BAT file (or EXE file) using Pe <salzo@yahoo.com>
Re: Problem executing a BAT file (or EXE file) using Pe <salzo@yahoo.com>
Re: Problem executing a BAT file (or EXE file) using Pe <cat@no-spam.com>
restore perl on cobalt server (Kermit Lowry)
Re: safe cgi programming in perl? [OT] <jk@emt.ee>
Re: safe cgi programming in perl? news@roaima.freeserve.co.uk
shorten expression <a@b.c>
Re: sprintf help (Greg Bacon)
Trying to go from 5.8.0 to 5.6.1, ActiveState installer (Sara)
Re: Use module (maybe) w/o dying nobull@mail.com
Win 32 Ole, Word Automation <peter_wilson@mail.com>
Re: Win32-OLE where's the info? <bart.lateur@pandora.be>
Re: Win32-OLE where's the info? <bart.lateur@pandora.be>
Re: Win32-OLE where's the info? <bart.lateur@pandora.be>
Re: Win32::OLE, Excel and OLE Automation question (Domenico Discepola)
Re: Win32::OLE, Excel and OLE Automation question <asu1@c-o-r-n-e-l-l.edu>
Re: XML attributes and values <usenet@expires082003.tinita.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Jul 2003 14:34:01 +0000 (UTC)
From: J Krugman <jill_krugman@yahoo.com>
Subject: Book on SSL programming with Perl?
Message-Id: <bf13cp$fcl$1@reader1.panix.com>
I'm reading Lincoln Stein's "Network Programming with Perl" and
liking it a lot. One problem with it, though, is that it says
nothing about SSL programming, which is the aspect of network
programming I know least about and am most eager to learn.
Can someone recommend a book that covers SSL programming in Perl?
I am not interested in a general book on SSL or cryptography, but
in one that covers just enough of these topics as are needed to
write SSL programs.
Many thanks in advance,
-Jill
------------------------------
Date: 15 Jul 2003 05:01:47 -0700
From: contact_brad@email.com (bm)
Subject: Re: calling system command as another user
Message-Id: <c1d7e6a1.0307150401.19f7b201@posting.google.com>
"Gary Perkins" <yukky##@somewhere.com.au> wrote in message news:<3f139411$0$95043$c30e37c6@lon-reader.news.telstra.net>...
> This works when I run it as a stand alone perl script just not when called
> via CGI??
>
Your CGI probably runs as the user 'nobody'. 'nobody' probably does
not have permissions to update your password file.
In which case you need to look at running your script under setuid,see
'man setuid' on your web server.
More importantly though, you need to look at "perldoc perlsec".
------------------------------
Date: 15 Jul 2003 07:07:32 -0700
From: ksu1wd@mit.edu (Avatar)
Subject: Cleaning out a text file.
Message-Id: <415d5171.0307150607.5fe8a4d4@posting.google.com>
I am trying to just open a file and clear it. Is there an easier way
to do this than the way I have done.
open (DELETE, ">$filename");
print DELETE "";
close DELETE;
------------------------------
Date: Tue, 15 Jul 2003 14:17:52 +0000 (UTC)
From: "Peter Wilson" <peter_wilson@mail.com>
Subject: Re: Cleaning out a text file.
Message-Id: <bf12eg$dol$1@sparta.btinternet.com>
"Avatar" <ksu1wd@mit.edu> wrote in message
news:415d5171.0307150607.5fe8a4d4@posting.google.com...
> I am trying to just open a file and clear it. Is there an easier way
> to do this than the way I have done.
>
> open (DELETE, ">$filename");
> print DELETE "";
> close DELETE;
Why not just unlink it?
Peter
------------------------------
Date: Tue, 15 Jul 2003 09:21:49 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Cleaning out a text file.
Message-Id: <87d6gban0i.fsf@limey.hpcc.uh.edu>
>> On Tue, 15 Jul 2003 14:17:52 +0000 (UTC),
>> "Peter Wilson" <peter_wilson@mail.com> said:
> "Avatar" <ksu1wd@mit.edu> wrote in message
> news:415d5171.0307150607.5fe8a4d4@posting.google.com...
>> I am trying to just open a file and clear it. Is there
>> an easier way to do this than the way I have done.
>>
>> open (DELETE, ">$filename");
>> print DELETE "";
>> close DELETE;
> Why not just unlink it?
Well, it's possible that the file needs to remain in
existence, but be empty.
The OP should just open for write and close immediately
(and check the success of the open() too).
hth
t
------------------------------
Date: Tue, 15 Jul 2003 14:47:23 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Cleaning out a text file.
Message-Id: <x71xwr7sp1.fsf@mail.sysarch.com>
>>>>> "TC" == Tony Curtis <tony_curtis32@yahoo.com> writes:
>>> open (DELETE, ">$filename");
>>> print DELETE "";
>>> close DELETE;
>> Why not just unlink it?
TC> Well, it's possible that the file needs to remain in
TC> existence, but be empty.
TC> The OP should just open for write and close immediately
TC> (and check the success of the open() too).
perldoc -f truncate
or unlink and utime will do it.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 15 Jul 2003 14:57:10 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Cleaning out a text file.
Message-Id: <aDUQa.1$1q6.0@nwrddc04.gnilink.net>
Uri Guttman wrote:
>>>>>> "TC" == Tony Curtis <tony_curtis32@yahoo.com> writes:
>
> >>> open (DELETE, ">$filename");
> >>> print DELETE "";
> >>> close DELETE;
>
> >> Why not just unlink it?
>
>> Well, it's possible that the file needs to remain in
>> existence, but be empty.
>
>> The OP should just open for write and close immediately
>> (and check the success of the open() too).
>
> perldoc -f truncate
>
> or unlink and utime will do it.
Careful! If you unlink the file then only this directoy entry will be
removed. If there are several hard links pointing to the same file, then
maybe the OPs intention was to actually empty this original file.
Unlink will actually remove the entry and when re-creating a file with the
same name it will be a new file that is not related to the old file any
longer, i.e. the other hardlinks will still point to the old file.
jue
------------------------------
Date: 15 Jul 2003 14:59:40 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Cleaning out a text file.
Message-Id: <slrnbh85ms.rf1.abigail@alexandra.abigail.nl>
Avatar (ksu1wd@mit.edu) wrote on MMMDCV September MCMXCIII in
<URL:news:415d5171.0307150607.5fe8a4d4@posting.google.com>:
,, I am trying to just open a file and clear it. Is there an easier way
,, to do this than the way I have done.
,,
,, open (DELETE, ">$filename");
,, print DELETE "";
,, close DELETE;
truncate $filename => 0 or die "Failed to truncate $filename: $!\n";
Or the quick and dirty:
system ">$filename";
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: 15 Jul 2003 07:47:14 -0700
From: jzh9@yahoo.com (Joey)
Subject: Determine a child PID
Message-Id: <3b88eb74.0307150647.4eba5634@posting.google.com>
I am trying to determine the PID when opening of a file handle from within
my main perl code. Here is a snip where i call the open file handle.
$infile = 'infile';
open(IF, "tail -f $infile|") or die "Cannot open pipe $infile\n";
while (<IF>) {
do_smothing()
}
In the example below in unix the main perl code has a pid of perl variable
$$ (PID=18629) then the open file handle has another PID, a child of the
parent (PID = 18630)
% ps -ef| grep tail
user 18632 18455 0 10:42:06 pts/10 0:00 grep tail
user 18630 18629 0 10:42:02 pts/10 0:00 tail -f infile
% ps -ef| grep myscript.pl
user 18634 18455 0 10:42:12 pts/10 0:00 grep myscript.pl
user 18629 18455 0 10:42:02 pts/10 0:00 /usr/bin/perl ./myscript.pl
Is there a way within perl to get the child PID 18630 ?
Thanks in advance.
Joey
------------------------------
Date: Tue, 15 Jul 2003 09:41:52 +0000
From: darkname <member31962@dbforums.com>
Subject: ERROR.. with regex!!
Message-Id: <3111508.1058262112@dbforums.com>
I have the following code!!
foreach $line (@fich){
$i++;
foreach $comm (@com){
if(($line eq $comm)||($line=~/$comm/)){
print"Line $i: $comm";
}
}
}
The problem is that the instruction in the if condition ($line=~/$comm/)
gives me an error!!! "Nested quantifiers before HERE mark in regex m//**
<< HERE"....
The @comm and @fich arrays contain the contents of two distinct files!
Can someone tell me why this code gives me this error!?
Tank you all
--
Posted via http://dbforums.com
------------------------------
Date: 15 Jul 2003 11:25:52 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: ERROR.. with regex!!
Message-Id: <slrnbh7p60.qtp.abigail@alexandra.abigail.nl>
darkname (member31962@dbforums.com) wrote on MMMDCV September MCMXCIII in
<URL:news:3111508.1058262112@dbforums.com>:
][
][ I have the following code!!
][
][ foreach $line (@fich){
][ $i++;
][ foreach $comm (@com){
][ if(($line eq $comm)||($line=~/$comm/)){
][ print"Line $i: $comm";
][ }
][ }
][ }
][
][ The problem is that the instruction in the if condition ($line=~/$comm/)
][ gives me an error!!! "Nested quantifiers before HERE mark in regex m//**
][ << HERE"....
You have something like '++', '**', or '?+' in $comm. What are you trying
to do? Have a match if $comm appears exactly as is in $line? In that
case, use index(). If you do want to use $comm as a regexp, you need to
make it valid.
Abigail
--
$" = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%_ = (Just => another => Perl => Hacker); &{%_};
------------------------------
Date: Tue, 15 Jul 2003 13:02:07 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: ERROR.. with regex!!
Message-Id: <v27du-c63.ln1@moldev.cmagroup.co.uk>
darkname <member31962@dbforums.com> wrote:
> foreach $line (@fich){
> $i++;
> foreach $comm (@com){
> if(($line eq $comm)||($line=~/$comm/)){
> print"Line $i: $comm";
> }
> }
> }
> The problem is that the instruction in the if condition ($line=~/$comm/)
> gives me an error!!! "Nested quantifiers before HERE mark in regex m//**
> << HERE"....
You've got some Regular Express characters in your $comm string. If this
is not what you intend, then you need to escape the string as described in
"perldoc perlre":
$line =~ /\Q$comm\E/
> The @comm and @fich arrays contain the contents of two distinct files!
I suspect you've included the trailing newline in them. Based on your
code I suspect this isn't really what's intended, so use chomp() to
strip off the trailing newline character as you read in the arrays,
and put an explicit trailing newline in your print statement.
Finally, consider whether you really need to read in the second of the
two files.
Chris
--
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
------------------------------
Date: 15 Jul 2003 06:31:54 -0700
From: jkeen@concentric.net (James E Keenan)
Subject: Re: ERROR.. with regex!!
Message-Id: <b955da04.0307150531.a0e0ddf@posting.google.com>
darkname <member31962@dbforums.com> wrote in message news:<3111508.1058262112@dbforums.com>...
>
> foreach $line (@fich){
> $i++;
> foreach $comm (@com){
> if(($line eq $comm)||($line=~/$comm/)){
> print"Line $i: $comm";
> }
> }
> }
>
> The problem is that the instruction in the if condition ($line=~/$comm/)
> gives me an error!!! "Nested quantifiers before HERE mark in regex m//**
> << HERE"....
>
Once I pre-declare all the variables, the code compiles properly under
use strict and use warnings. (You are using these pragmata, right?)
Hence, I would infer that you have a run-time problem. My first
suggestion would be that you check the value of $comm at the line
where you get the error. Perhaps characters are being interpolated
here which give the error.
------------------------------
Date: Tue, 15 Jul 2003 15:17:47 +0200
From: mathias <mathias@gms.lu>
Subject: filehandle to variable problem
Message-Id: <3f13fefc$1@news>
Hello all,
i try to store filehandle in variable (as described in perl cookbook
for instance) and i am not able to use the variable afterwards.
instead of getting the expected content of the var, i get something
like *main::FH or main::STDOUT or GLOB(0x80f60ac)
you can see the sample script i use at:
http://www.tiasarea.org/perl.html
http://www.tiasarea.org/perl2.html
http://www.tiasarea.org/perl3.html
Thank you for any help
greetings
Mathias
------------------------------
Date: Tue, 15 Jul 2003 13:21:27 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: filehandle to variable problem
Message-Id: <vh7vunrb5h8012@corp.supernews.com>
In article <3f13fefc$1@news>,
mathias <mathias@gms.lu> wrote:
: i try to store filehandle in variable (as described in perl cookbook
: for instance) and i am not able to use the variable afterwards.
: instead of getting the expected content of the var, i get something
: like *main::FH or main::STDOUT or GLOB(0x80f60ac)
It's a filehandle. Why do you care what it looks like when you print
its internal representation? What did you expect to happen?
Greg
--
... the only difference between direct democracy and a dictatorship is
the number of feet on your throat.
-- Jim Peron
------------------------------
Date: Tue, 15 Jul 2003 15:45:56 +0200
From: mathias <mathias@gms.lu>
Subject: Re: filehandle to variable problem
Message-Id: <3f140595$1@news>
Greg Bacon wrote:
> : like *main::FH or main::STDOUT or GLOB(0x80f60ac)
>
> It's a filehandle. Why do you care what it looks like when you print
> its internal representation? What did you expect to happen?
>
> Greg
well i was waiting for bla instead of any of the strings i had.
can you give me a way then to get "bla" from this filehandle ?
thank you
Mathias
------------------------------
Date: Tue, 15 Jul 2003 16:32:45 +0200
From: "Peter Dintelmann" <peter.dintelmann@dresdner-bank.com>
Subject: Re: flock() and W95
Message-Id: <bf1226$at3@news-1.bank.dresdner.net>
Hi,
"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:benvsi$7a8sl$1@ID-184292.news.uni-berlin.de...
> Since flock() results in a fatal error on Windows 95 and 98, while I'm
> doing development on a W98 box, there are quite a few statements like
> this:
[snip]
since I have no W95/98 box available, can you tell
what the output of
perl -MConfig -le "print $Config{d_flock}"
is on such a system?
TIA,
Peter Dintelmann
------------------------------
Date: Tue, 15 Jul 2003 17:00:25 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: flock() and W95
Message-Id: <bf14s5$a0qi5$1@ID-184292.news.uni-berlin.de>
Peter Dintelmann wrote:
> since I have no W95/98 box available, can you tell
> what the output of
>
> perl -MConfig -le "print $Config{d_flock}"
>
> is on such a system?
It outputs:
define
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 15 Jul 2003 06:53:34 -0700
From: fatted@yahoo.com (fatted)
Subject: if-map vrs foreach-if
Message-Id: <4eb7646d.0307150553.3ae7aedd@posting.google.com>
I have this piece of code ($db_keywords is an array ref of array
references):
if(map($_->[0] =~ /\b$keyword\b/i,@$db_keywords))
{
print "Matched $keyword\n";
}
Which worked fine and dandy, but I now want to know what the value of
$_->[1] is at a match. Now I achieved this as follows:
foreach my $db_k (@$db_keywords)
{
if($db_k->[0] =~ /\b$keyword\b/i)
{
print "$keyword $db_k->[0] $db_k->[1]\n";
}
}
What I'd like to know though:
Is there a way of achieving this (accessing the 2 values of the array
reference at a matching point in $db_keywords) using the if-map style
syntax I was originally using.
------------------------------
Date: Tue, 15 Jul 2003 14:54:22 +0000 (UTC)
From: Perusion hostmaster <nanae@perusion.com>
Subject: Re: if-map vrs foreach-if
Message-Id: <slrnbh85d2.h8e.nanae@ns.valuemedia.com>
On 15 Jul 2003 06:53:34 -0700, fatted <fatted@yahoo.com> wrote:
> I have this piece of code ($db_keywords is an array ref of array
> references):
>
> if(map($_->[0] =~ /\b$keyword\b/i,@$db_keywords))
> {
> print "Matched $keyword\n";
> }
>
> Which worked fine and dandy, but I now want to know what the value of
> $_->[1] is at a match. Now I achieved this as follows:
>
> foreach my $db_k (@$db_keywords)
> {
> if($db_k->[0] =~ /\b$keyword\b/i)
> {
> print "$keyword $db_k->[0] $db_k->[1]\n";
> }
> }
>
> What I'd like to know though:
> Is there a way of achieving this (accessing the 2 values of the array
> reference at a matching point in $db_keywords) using the if-map style
> syntax I was originally using.
Why does it matter? Unless performance is a big issue, I would go
for some simplicity and clarity:
my $regex = qr/\b$keyword\b/;
for my $db_k (@$db_keywords) {
next unless $db_k->[0] =~ $regex;
print "$keyword $db_k->[0] $db_k->[1]\n";
}
Compiling the regex only once is a good idea if you have a sizable
array.
--
Perusion Hostmaster
"Being against torture ought to be sort of a bipartisan thing."
-- Karl Lehenbauer
------------------------------
Date: 15 Jul 2003 06:45:38 -0700
From: bduffy@nycap.rr.com (Brian Duffy)
Subject: Listing machine accounts & sids in an NT 4 domain?
Message-Id: <8382da14.0307150545.51ca3e34@posting.google.com>
Hello list,
I'm trying to generate lists of machines & sids in Windows NT 4 & W2k
AD domains to help detect machines that get re-imaged with a new copy
of windows. I'm currently operating on the assumption that when a
machine is re-imaged a new SID will be generated and kept at the
domain level.
I figure if I can list all of the thousands of machine sids in the
domain and place them in a database, I can periodically list all the
machine SIDs again and easily identifity the ones that have changed.
The only problem is, I am having difficulty finding a perl function
that returns both the name & the sid of the workstation.
Could anyone point me in the right direction?
Brian Duffy
bduffy@nycap.nospam.rr.com
------------------------------
Date: Tue, 15 Jul 2003 14:25:26 +0000 (UTC)
From: "Peter Wilson" <peter_wilson@mail.com>
Subject: Re: Listing machine accounts & sids in an NT 4 domain?
Message-Id: <bf12sm$74h$1@hercules.btinternet.com>
"Brian Duffy" <bduffy@nycap.rr.com> wrote in message
news:8382da14.0307150545.51ca3e34@posting.google.com...
> Hello list,
>
> I'm trying to generate lists of machines & sids in Windows NT 4 & W2k
> AD domains to help detect machines that get re-imaged with a new copy
> of windows. I'm currently operating on the assumption that when a
> machine is re-imaged a new SID will be generated and kept at the
> domain level.
>
> I figure if I can list all of the thousands of machine sids in the
> domain and place them in a database, I can periodically list all the
> machine SIDs again and easily identifity the ones that have changed.
>
> The only problem is, I am having difficulty finding a perl function
> that returns both the name & the sid of the workstation.
>
> Could anyone point me in the right direction?
>
> Brian Duffy
> bduffy@nycap.nospam.rr.com
tried looking in the registry?
see
Win32::TieRegistry
Peter
------------------------------
Date: Tue, 15 Jul 2003 10:37:46 -0400
From: "Tom Salzmann" <salzo@yahoo.com>
Subject: Re: Problem executing a BAT file (or EXE file) using Perl as CGI script under Apache.
Message-Id: <zjUQa.458$x16.19236@eagle.america.net>
Cat, Thanks for the reply.
I have tried your advice to no avail. The perl file works FINE from the
commandline and it does RUN from apache (I echo things to the resulting
html) but the calls to NT to run the BAT file fail... I tried it two ways
this time - the open() approach and using system().
Again, from the commandline, the PERL program runs the BAT file fine every
time. From Apache, the perl file runs but the BAT file is apparently
ignored.... I'll try to get return codes from system() next.
Thanks!
Tom
------------------------------
Date: Tue, 15 Jul 2003 10:51:31 -0400
From: "Tom Salzmann" <salzo@yahoo.com>
Subject: Re: Problem executing a BAT file (or EXE file) using Perl as CGI script under Apache.
Message-Id: <xwUQa.463$x16.19256@eagle.america.net>
The return code I get is 65280... exit_code of 255.
??
Thoroughly confused...
Tom
"Tom Salzmann" <salzo@yahoo.com> wrote in message
news:zjUQa.458$x16.19236@eagle.america.net...
> Cat, Thanks for the reply.
>
> I have tried your advice to no avail. The perl file works FINE from the
> commandline and it does RUN from apache (I echo things to the resulting
> html) but the calls to NT to run the BAT file fail... I tried it two ways
> this time - the open() approach and using system().
>
> Again, from the commandline, the PERL program runs the BAT file fine every
> time. From Apache, the perl file runs but the BAT file is apparently
> ignored.... I'll try to get return codes from system() next.
>
> Thanks!
> Tom
>
>
------------------------------
Date: Tue, 15 Jul 2003 22:39:52 +1000
From: Cat <cat@no-spam.com>
Subject: Re: Problem executing a BAT file (or EXE file) using Perl as CGI script under Apache.
Message-Id: <3F13F618.64805F5D@no-spam.com>
Tom Salzmann wrote:
>
> I have developed some perl code to run as a script under Windows 2000
> running apache. This works GREAT on Win2k but on WinNT, perl is simply
> unable to launch the program. The program works fine from the command line.
>
> Here's the code:
>
> $fred=time . ".out" ;
> open(OUTPUT, "|imon.bat " . $fred . " " . $ENV{'REMOTE_ADDR'} . " " .
> $IMCommand . " " . $IMFile );
> close OUTPUT;
> open(FILE, $fred );
> @htmlLines = <FILE>;
> close FILE ;
> unlink($fred);
> unlink($IMFile);
>
> As a test to make sure I wasn't nuts, I put the following in the bat file:
>
> ECHO >> echo.out
>
> And sure enough, I get "ECHO IS ON" in the file every time I run from
> command line. But when I run from Apache, I get NOTHING. It's as if Apache
> is unable to launch the thing.
>
> Again, this works FINE under Win2k but fails on WinNT - Any ideas? I tried
> system() but I get the same thing.
>
> Thanks,
>
> Tom
Check the Apache log files for clues
Include the full path to imon.bat and see if that works
Maybe try hard coding the parameters to imon.bat or simplifying it
eg open(OUTPUT, "|imon.bat 1234.out 127.0.0.1 echo test.txt");
inet.bat can be something like
ECHO %1 %2 %3 %4 >> echo.out
------------------------------
Date: 15 Jul 2003 05:42:07 -0700
From: kermit.lowry@kp.org (Kermit Lowry)
Subject: restore perl on cobalt server
Message-Id: <fc1b3c4e.0307150442.27bf9dc6@posting.google.com>
I have received messages on my cobalt server recently (see below) and
it has destroyed my gui. The files are under /usr/lib/perl5. I don't
know the extent of the issue. I have two pleas:
1) Does anyone know what has caused this?
2) Can I restore the exact perl distribution on the cobalt server and
how would I do it? I do not have the cobalt install disks.
Thank you in advance for your assistance,
Kermit Lowry
"My company won't claim any of my ideas or work!!!"
DELETION: [www.domain.com]
/usr/lib/perl5/5.00503/Class/Struct.pm
Inode Permissons Size Created On
20652 -r--r--r-- 13923 May 14 03:20 2001
DELETION: [www.domain.com]
/usr/lib/perl5/5.00503/Time/Local.pm
Inode Permissons Size Created On
20657 -r--r--r-- 4220 May 14 03:20 2001
DELETION: [www.domain.com]
/usr/lib/perl5/5.00503/Time/gmtime.pm
Inode Permissons Size Created On
20658 -r--r--r-- 2518 May 14 03:20 2001
DELETION: [www.domain.com]
/usr/lib/perl5/5.00503/Time/localtime.pm
Inode Permissons Size Created On
20659 -r--r--r-- 2349 May 14 03:20 2001
DELETION: [www.domain.com] /usr/lib/perl5/5.00503/Time/tm.pm
Inode Permissons Size Created On
20660 -r--r--r-- 667 May 14 03:20 2001
~
------------------------------
Date: Tue, 15 Jul 2003 15:10:04 +0300
From: Jan Kumpas <jk@emt.ee>
Subject: Re: safe cgi programming in perl? [OT]
Message-Id: <3F13EF1C.F415B70A@emt.ee>
hi,
> > open
>
> _That_ must be Perl's open(), I don't think there is a shell "open".
it depends, actually there is a "shell" open,
open (1) - start a program on a new virtual terminal (VT).
--
Grtz,
Jan
------------------------------
Date: Tue, 15 Jul 2003 11:33:01 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: safe cgi programming in perl?
Message-Id: <tr1du-qkb.ln1@moldev.cmagroup.co.uk>
Tad McClellan <tadmc@augustmail.com> wrote:
> Allowing dot may be dangerous, as it can have meta-meaning in a path.
> What if
> $pairs{affilate_ID} = '../etc/passwd';
But equally, one has to consider these:
$pairs{affilate_ID} = 'some.valid.file';
$pairs{affilate_ID} = '.../hiddenfile';
Chris
--
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
------------------------------
Date: Tue, 15 Jul 2003 16:42:39 +0200
From: ZZT <a@b.c>
Subject: shorten expression
Message-Id: <bf13t2$n74$1@news1.wdf.sap-ag.de>
Hi,
is there a way to shorten this expression?
$host=~/^(\S*)\s*/; $host=$1;
thanks!
------------------------------
Date: Tue, 15 Jul 2003 13:19:30 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: sprintf help
Message-Id: <vh7vr2pj4rgkd1@corp.supernews.com>
In article <vh7bj9fb6sm239@corp.supernews.com>,
Matt Oliverius <moliverius@w-link.net> wrote:
: Does anyone know of an alternate way of doing the following in Perl?
:
: @caps{@buckets} = ('Half','Full')
: [sprintf('%0*b', scalar @buckets, $_) =~ /[01]/g];
That's a neat little trick. You could write it more clearly as
my $mask = 1 << @buckets;
foreach my $b (@buckets) {
$caps{$b} = $_ & $mask ? "Full" : "Half";
$mask >>= 1;
}
Hope this helps,
Greg
--
Reading the FAQ is like staying in line--it's something you should
learn in kindergarten. Usenet needs a better kindergarten.
-- Larry Wall in <1995Nov9.193745.13694@netlabs.com>
------------------------------
Date: 15 Jul 2003 05:36:17 -0700
From: genericax@hotmail.com (Sara)
Subject: Trying to go from 5.8.0 to 5.6.1, ActiveState installer problems...
Message-Id: <776e0325.0307150436.6afc12a1@posting.google.com>
ack.. OK I'm on RH8.0 with 5.8.0 installed. I would like to go to
5.6.1 as 5.8.0 is constantly locking up my sessions (running scripts
that run fine in 5.6.1).
I snagged the 5.6.1 RPM from Active State
(ActivePerl-5.6.1.635-i686-linux.rpm) and tried to install it under
root:
[root@tux install]# rpm -Uvhf ActivePerl-5.6.1.635-i686-linux.rpm
Preparing...
########################################### [100%]
1:ActivePerl
########################################### [100%]
ln: `./.TheInstallScriptWasNotRunTheInstallScriptWasNotRunTheInstallScriptWasNotRun-perl':
then I tried:
cd /
find . -name .TheInstallScriptWasNotRunTheInstallScriptWasNotRunTheInstallScriptWasNotRun
and it comes back empty.
5.6.1 actually runs, except with the -d switch I get:
Can't locate perl5db.pl in @INC
so apparently the install stopped when it found this file or link
existed.
Can anyone point me to a working 5.6.1 rpm for linux 8? I searched on
www.perl.com and pretty much found no 5.6.1 - under ports it said "not
yet available" and in the main section it appeared only 5.8.0 was
offered.
Or else does anyone know how to get the Active State install to run
properly?
Thanks.
Gx
------------------------------
Date: 15 Jul 2003 06:16:36 -0700
From: nobull@mail.com
Subject: Re: Use module (maybe) w/o dying
Message-Id: <4dafc536.0307150516.724e1a7c@posting.google.com>
sholden@flexal.cs.usyd.edu.au (Sam Holden) wrote in message news:<slrnbh7fkd.75q.sholden@flexal.cs.usyd.edu.au>...
> On Tue, 15 Jul 2003 00:07:46 -0700, JS Bangs <jaspax@u.washington.edu> wrote:
> > I'm stumped. I wanted to use a module if it was available, but not to die
> > if the module was unavailable. I originally wrote:
> >
> > our $WHATIF = 0;
> > eval {
> > use Whatif;
> > $WHATIF = 1;
> > };
> eval "use Whatif;";
> $WHATIF = 1 unless $@;
I prefer the idiom:
our $WHATIF = eval "use Whatif; 1";
Or
our $WHATIF;
BEGIN {
$WHATIF = eval {
require Whatif;
import Whatif;
1;
}
}
------------------------------
Date: Tue, 15 Jul 2003 13:37:57 +0000 (UTC)
From: "Peter Wilson" <peter_wilson@mail.com>
Subject: Win 32 Ole, Word Automation
Message-Id: <bf103l$ahp$1@sparta.btinternet.com>
Hi
Im having problems putting pictures into my word document. I can get
pictures in but they all appear ontop of each other as oppose to where the
cursor is, I am also inserting a line on each page as well and that appears
at the wrong place as well. So I guess im doing something fundamentally
wrong. Can anyone tell me what im doing wrong or how to move the picture
onto each page, this is a small section of a larger document so I would like
to have lots of flexibility this is why have decided not to use a mail
merge.
Any help would be greatly appreciated.
Thanks
Peter
my $Word = Win32::OLE->new('Word.Application', 'Quit');
$Word->{'Visible'} = 1;
my $doc = $Word->Documents->Add;
$doc->PageSetup->{Orientation} = wdOrientLandscape;
$doc->PageSetup->{TopMargin} = 0;
$doc->PageSetup->{BottomMargin} = 0;
$doc->PageSetup->{LeftMargin} = 0;
$doc->PageSetup->{RightMargin} = 0;
$thisdoc = $Word->ActiveDocument;
$cgm_image = $thisdoc->Shapes->AddPicture(
"C:\\Data\\CD-1\\VWR005230-C\\Service\\VWR005230-C-01-01-English.cgm",
False, True, 0, 0, 778.1, 553.05);
$cgm_image->{Left} = wdShapeCenter;
$line = $doc->Shapes->AddLine(44,540,803,540);
$line->{'Line'}->{Weight} = 10;
$Word->Selection->EndKey(wdStory);
$Word->Selection->InsertBreak(wdPageBreak);
$cgm_image1 = $thisdoc->Shapes->AddPicture(
"C:\\Data\\CD-1\\VWR005230-C\\Service\\VWR005230-C-01-01-Dutch.cgm",
False, True, 0, 800, 778.1, 553.05);
$cgm_image1->{Left} = wdShapeCenter;
$line = $doc->Shapes->AddLine(44,540,803,540);
$line->{'Line'}->{Weight} = 10;
$Word->Selection->EndKey(wdStory);
$Word->Selection->InsertBreak(wdPageBreak);
------------------------------
Date: Tue, 15 Jul 2003 11:51:11 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Win32-OLE where's the info?
Message-Id: <iiq7hvku66qlh85jq7vtauh6u3umnamjgl@4ax.com>
Mark S Pryor wrote:
>Try my stand alone applet.
>TLViewer: turbo Object Browser for scripting
>http://mysite.verizon.net/res1ur2j/tlviewer.htm
>
>I even include the Perl creation code for the selected
>object.
Despite your claim that "You only need Tlbinf32.dll installed which
comes on late model OS.", I apparently don't have this file. I can't
find it on Microsoft's website either. What gives...?
--
Bart.
------------------------------
Date: Tue, 15 Jul 2003 11:56:12 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Win32-OLE where's the info?
Message-Id: <tsq7hvs93qkit4g3lj6vo10a60lulkti4c@4ax.com>
Bart Lateur wrote:
>Despite your claim that "You only need Tlbinf32.dll installed which
>comes on late model OS.", I apparently don't have this file. I can't
>find it on Microsoft's website either. What gives...?
OK, I found it one *your* website (duh), but even after downloading it
and putting it in "c:\windows\system32", the program still complains
that it can't find it. (Windows 98)
--
Bart.
------------------------------
Date: Tue, 15 Jul 2003 12:02:15 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Win32-OLE where's the info?
Message-Id: <r8r7hvc55plinl6j7819bumqfolo0jbf5m@4ax.com>
Bart Lateur wrote:
>>Despite your claim that "You only need Tlbinf32.dll installed which
>>comes on late model OS.", I apparently don't have this file. I can't
>>find it on Microsoft's website either. What gives...?
>
>OK, I found it one *your* website (duh), but even after downloading it
>and putting it in "c:\windows\system32", the program still complains
>that it can't find it. (Windows 98)
Solved it. Running
regsvr32 c:\windows\system32\tlbinf32.dll
at the command prompt in c:\windows\system did the trick.
--
Bart.
------------------------------
Date: 15 Jul 2003 05:34:53 -0700
From: joeminga@yahoo.com (Domenico Discepola)
Subject: Re: Win32::OLE, Excel and OLE Automation question
Message-Id: <698c67f.0307150434.998152e@posting.google.com>
"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns93B9985BBBFFasu1cornelledu@132.236.56.8>...
> joeminga@yahoo.com (Domenico Discepola) wrote in
> news:698c67f.0307141907.40cca162@posting.google.com:
>
> > Hello. I have a protected Excel file (i.e. locked cells) that I
> > created. I want to remove the protection on 1 column using
> > Win32::OLE. Unfortunately, I cannot find my answer in the Microsoft
> > online help. Any suggestions would be appreciated. I suspect that my
> > problem lies in my understanding of OLE Automation and how its methods
> > and properties tie in with PERL so any "cookbook" links would help as
> > well. Using the object browser in Excel (alt-f11, f2) does not
> > provide me with clear enough examples...
>
> I am not sure I could do a good job of explaining what is wrong with your
> code. Your original code produce some "useless use of hash" warnings.
> However, the following might be of some help:
>
> #! C:/Perl/bin/perl.exe
> use strict;
> use warnings;
>
> use Win32::OLE qw(in with);
> use Win32::OLE::Const 'Microsoft Excel';
> $Win32::OLE::Warn = 3;
>
> $| = 1;
>
> my $my_file = shift @ARGV;
>
> unless ($my_file) {
> print STDERR "Usage: $0 excelfile\n";
> exit 2;
> }
>
> my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
> || Win32::OLE->new('Excel.Application', 'Quit');
>
> $Excel->{Visible} = 1;
> my $Book = $Excel->Workbooks->Open("$my_file");
> my $Sheet = $Book->Worksheets(1);
>
> my $Range = $Sheet->Columns("E:E");
> $Range->{Locked} = 0;
>
> $Book->Save;
> $Book->Close;
>
> exit 0;
>
> See also
> http://aspn.activestate.com/ASPN/Perl/Products/ActivePerl/site/lib/Win32/
> OLE.html
Thanks for the reply - I still got an error message:
C:\work\win32_ole>perl p1.pl c:\work\win32_ole\104.xls
OLE exception from "Microsoft Excel":
Unable to set the Locked property of the Range class
Win32::OLE(0.1603) error 0x80020009: "Exception occurred"
in PROPERTYPUT "Locked" at p1.pl line 26
I then remembered that the Excel workbook was password protected. I
added the line: $Sheet->Unprotect("${my_password}"); and it worked
fine. Thanks for the Activestate URL...
------------------------------
Date: 15 Jul 2003 12:59:21 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Win32::OLE, Excel and OLE Automation question
Message-Id: <Xns93B95B725E3A7asu1cornelledu@132.236.56.8>
joeminga@yahoo.com (Domenico Discepola) wrote in
news:698c67f.0307150434.998152e@posting.google.com:
> Thanks for the reply
You are wlcome.
...
> I then remembered that the Excel workbook was password protected. I
> added the line: $Sheet->Unprotect("${my_password}"); and it worked
> fine. Thanks for the Activestate URL...
I am curious: $my_password is simply a string variable, right? Why do you
use
$Sheet->Unprotect("${my_password}");
rather than
$Sheet->Unprotect($my_password);
It seems to work, but I'd like to know if there is any reason to prefer
the former.
Sinan
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: 15 Jul 2003 13:17:14 GMT
From: Tina Mueller <usenet@expires082003.tinita.de>
Subject: Re: XML attributes and values
Message-Id: <bf0usq$9thb4$1@ID-24002.news.uni-berlin.de>
Saya wrote:
[...]
> assuming a XML document as above with alot of data tags containing
> tuple tags. I want to find all tuples that have a name value equals to
> "Reg" and extract the tags value (eg. EU). How do I achieve that in
> Perl.
see http://perl-xml.sourceforge.net/ for info about
perl and XML.
hth, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://www.perlquotes.de/ \ \ _,_\ __/\ __/_| /__/ perception
- my mail address expires end of august 2003 -
------------------------------
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 5225
***************************************