[12886] in Perl-Users-Digest
Perl-Users Digest, Issue: 296 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 29 11:17:24 1999
Date: Thu, 29 Jul 1999 08:10:18 -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 Thu, 29 Jul 1999 Volume: 9 Number: 296
Today's topics:
Newbie Q: How to check if invoked as CGI program <andrewf@beausys.demon.co.uk>
Re: Newbie Q: How to check if invoked as CGI program <swiftkid@bigfoot.com>
Re: NEWSFLASH: Supremes rule anti-advert-ware illegal <gellyfish@gellyfish.com>
Re: NEWSFLASH: Supremes rule anti-advert-ware illegal <gellyfish@gellyfish.com>
Re: Perl 5.005_58 ... a bug. <swiftkid@bigfoot.com>
Re: Regex global search/replace problem (Abigail)
Re: Running a CGI script as a specific user?? (Abigail)
Re: Running a CGI script as a specific user?? <swiftkid@bigfoot.com>
Stopping one from breaking the script <bhall@omega.scs.carleton.ca>
Re: Stopping one from breaking the script (I R A Darth Aggie)
Using ActiveX data objects and Win32::ole <newsreply@mpguy.freeserve.co.uk>
Re: Using ActiveX data objects and Win32::ole (Michel Dalle)
Re: Using perl with another language? <tchrist@mox.perl.com>
Why this not work HELP! (Ryan Ngi)
Re: Why this not work HELP! <swiftkid@bigfoot.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 29 Jul 1999 15:30:04 +0100
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Newbie Q: How to check if invoked as CGI program
Message-Id: <4gMxtDAsVGo3EwhV@beausys.demon.co.uk>
I have written a program which operates in one of
two modes:
* as a CGI program (invoked via a request to the web server)
* as a non-CGI program (invoked locally)
Naturally, there are some differences between the two modes of
operation in regards to the inputs and outputs.
The question is ... is there a foolproof way of being able to detect
how the program was invoked ? ... and thus determine the appropriate
mode to adopt.
I know there is a means of detecting if a program is running
interactively (using -t STDIN, -t STDOUT), but I assume that
this isnt the solution here.
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).
------------------------------
Date: Thu, 29 Jul 1999 19:40:15 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Newbie Q: How to check if invoked as CGI program
Message-Id: <7nqsf2$oo06@news.cyber.net.pk>
: The question is ... is there a foolproof way of being able to detect
: how the program was invoked ? ... and thus determine the appropriate
: mode to adopt.
Check out the contents of %ENV in both cases.
------------------------------
Date: 29 Jul 1999 14:56:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <37a05d86@newsread3.dircon.co.uk>
In comp.lang.perl.misc Tom Christiansen <tchrist@mox.perl.com> wrote:
> The Supreme Court today upheld the lower courts' ruling that the viewing
> of a website in any layout and format other than the one set-up by that
> site's authors was illegal.
>
Oh well thats alright then - the proxy I'm working on
(<http://karamazov.gellyfish.com/cgi-bin/hbc_proxy>) only takes those
useless MS fphover applets out .... ;-}
/J\
--
"Michael Ancram, you haven't got a hope in hell of winning the next
election" - Huw Edwards, BBC News
------------------------------
Date: 29 Jul 1999 15:16:03 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <37a06223@newsread3.dircon.co.uk>
In comp.lang.perl.misc Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> In comp.lang.perl.misc Tom Christiansen <tchrist@mox.perl.com> wrote:
>> The Supreme Court today upheld the lower courts' ruling that the viewing
>> of a website in any layout and format other than the one set-up by that
>> site's authors was illegal.
>>
>
> Oh well thats alright then - the proxy I'm working on
> (<http://karamazov.gellyfish.com/cgi-bin/hbc_proxy>) only takes those
> useless MS fphover applets out .... ;-}
>
Spooky - no sooner had I posted that than 207.87.178.66 showed up in my
server log <shiver>
/J\
--
"I must call a man in - I want to get felt laid down in the loft" -
Graham Norton
------------------------------
Date: Thu, 29 Jul 1999 19:34:33 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Perl 5.005_58 ... a bug.
Message-Id: <7nqs55$obf2@news.cyber.net.pk>
: : perl -V is broken!
: :
: : RedHat 6.0
:
: Well, that was fairly informative.
Sorry pal, I can't connect from Linux, and forgot to move the
file to the Windows partition..... :)
Here it goes: (CCed to perlbug@perl.com)
This is a bug report for perl from swiftkid@bigfoot.com
generated with the help of perlbug 1.26 running under perl 5.00558.
-----------------------------------------------------------------
[Please enter your report here]
Perl -V gives:
Undefined subroutine &main::myconfig called.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Site configuration information for perl 5.00558:
Configured by root at Wed Jul 28 20:31:29 PKT 1999.
Summary of my perl5 (revision 5.0 version 5 subversion 58) configuration:
Platform:
osname=linux, osvers=2.2.5-15, archname=i686-linux
uname='linux whizkid 2.2.5-15 #1 mon apr 19 23:00:46 edt 1999 i686
unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
use64bits=undef usemultiplicity=undef
Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL'
ccflags ='-Dbool=char -DHAS_BOOL'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lrt -lc -lposix -lcrypt
libc=/lib/libc-2.1.1.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
---
@INC for perl 5.00558:
/usr/local/lib/perl5/5.00558/i686-linux
/usr/local/lib/perl5/5.00558
/usr/local/lib/site_perl/5.00558/i686-linux
/usr/local/lib/site_perl
.
---
Environment for perl 5.00558:
HOME=/root
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/lo
cal/bin:/usr/X11R6/bin:/root/bin:/usr/local/bin
PERL_BADLANG (unset)
SHELL=/bin/bash
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
FAX: (815) 846-2877
------------------------------
Date: 29 Jul 1999 08:57:47 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Regex global search/replace problem
Message-Id: <slrn7q0ndt.f8f.abigail@alexandra.delanet.com>
CyberPsychotic (mlists@gizmo.kyrnet.kg) wrote on MMCLVIII September
MCMXCIII in <URL:news:Pine.LNX.4.05.9907291307350.1166-100000@gizmo.kyrnet.kg>:
`` hello people,
`` I am writing some sort of html preprocessorm and abit stuck with one
`` thing, so far I know the string:
`` $string =~ s/(.*)\/bl(\S+)(.*)/$1<blink>$2<\/blink>$3/gi
``
`` should replace all occurencies of /bl, with <blink>..</blink> stuff, but
`` in practice it replaces only first occurence of such string. Any ideas
`` what's wrong here?
No, it shouldn't. It should replace the last /bl on each line that's
followed by at least one non-blank.
Think what .* is doing.
`` PS: I solved this problem by appending while statement at the end:
`` $string =~ s/(.*)\/bl(\S+)(.*)/$1<blink>$2<\/blink>$3/gi
`` while ($string =~/[^<]\/bl/);
`` but I believe there should be a more elegant solution.
The more elegant solution is of course not to use '<blink>'.
Abigail
--
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jul 1999 08:59:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Running a CGI script as a specific user??
Message-Id: <slrn7q0nhr.f8f.abigail@alexandra.delanet.com>
Matt Carter (matt@thehub.co.uk) wrote on MMCLVIII September MCMXCIII in
<URL:news:37A03E58.49361A1@thehub.co.uk>:
&& Hi there,
&&
&& I am trying to find out how it is possible to run an ' open(FH, ">
&& filename") '.
&& function as a specific user, so I can write to a file without having to
&& chmod it so
&& it is writeable by everyone!
Of course. su to that user and run your program.
&& I'm restricted to Perl5.003, and a remotely hosted server (with telnet
&& access!)
open() has been around a lot longer than 5.003, so no problems there!
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 29 Jul 1999 19:22:16 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Running a CGI script as a specific user??
Message-Id: <7nqrdc$oo05@news.cyber.net.pk>
: && I am trying to find out how it is possible to run an ' open(FH, ">
: && filename") '.
: && function as a specific user, so I can write to a file without having to
: && chmod it so
: && it is writeable by everyone!
:
: Of course. su to that user and run your program.
I guess he wants it through CGI (according to the subject).... :P
chat2.pl - i guess?
------------------------------
Date: 29 Jul 1999 13:32:58 GMT
From: Ben Hall <bhall@omega.scs.carleton.ca>
Subject: Stopping one from breaking the script
Message-Id: <37A05927.2C4010F0@omega.scs.carleton.ca>
Hi, could someone tell me (preferibly by e-mail) how one can stop ctrl-c
from breaking out of my perl script? I wan't to catch it and send it to
/dev/null, I guess.
Thanks,
Ben
------------------------------
Date: 29 Jul 1999 14:21:02 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Stopping one from breaking the script
Message-Id: <slrn7q0ouh.meb.fl_aggie@thepentagon.com>
On 29 Jul 1999 13:32:58 GMT, Ben Hall <bhall@omega.scs.carleton.ca>, in
<37A05927.2C4010F0@omega.scs.carleton.ca> wrote:
+ Hi, could someone tell me (preferibly by e-mail) how one can stop ctrl-c
+ from breaking out of my perl script?
perlfaq8: How do I trap control characters/signals?
James
------------------------------
Date: Thu, 29 Jul 1999 14:38:02 +0100
From: "Matthew Guy" <newsreply@mpguy.freeserve.co.uk>
Subject: Using ActiveX data objects and Win32::ole
Message-Id: <37a058cb@news.intensive.net>
I am having a spot of bother at the moment, I am trying to set up a perl
script to access ODBC data sources via ADO, I can't seem to get at the
Recordset field values, here is my code below :
#!c:\perl\bin\perl
use Win32::OLE;
my $connect = Win32::OLE->new("ADODB.Connection");
$connect->Open("test"); #obdc data source name
my $recordset = $connect->Execute("SELECT * FROM CONTROL.DBF");
$recordset->MoveFirst();
my $fields = $recordset->???????;
$connect->Close();
what do I put in for ???????
I am using the apache web server and ActivePerl
please help
------------------------------
Date: Thu, 29 Jul 1999 14:17:10 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Using ActiveX data objects and Win32::ole
Message-Id: <7npntc$p70$1@news.mch.sbs.de>
In article <37a058cb@news.intensive.net>, "Matthew Guy" <newsreply@mpguy.freeserve.co.uk> wrote:
>I am having a spot of bother at the moment, I am trying to set up a perl
>script to access ODBC data sources via ADO, I can't seem to get at the
>Recordset field values, here is my code below :
[snip]
>I am using the apache web server and ActivePerl
>please help
Here's a five-step program that will answer all your questions :
1) In the ActiveState documentation (...\Perl\html\index.html), you'll
find the ActivePerl FAQ.
2) In there, you'll find the topic "Using OLE with Perl"
3) Looking there, you'll see the topic "How do I use ADO ?"
4) Reading that topic, you'll find a pointer to the 'ADO FAQ'.
5) Click on that link and read the article.
Where to find more information about the RecordSet object,
its methods and properties ? Well, in the ADO documentation
at the MSDN site, for instance :
http://msdn.microsoft.com/library/sdkdoc/dasdk/mdao2zdv.htm
You'll see that MoveFirst is not really necessary the first time,
or that EOF will be False as long as there are any records left.
But once you get on this level, Perl doesn't have much to do with it
anymore...
Michel.
------------------------------
Date: 29 Jul 1999 07:06:30 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Using perl with another language?
Message-Id: <37a051d6@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
mgjv@comdyn.com.au (Martien Verbruggen) writes:
:I don't think 'system call' means what you think it means. :)
The geek-to-luser correspondence table in the contest at
http://language.perl.com/misc/geekspeak.html reveals that,
"When I say system call, I mean what you would call operating
system function call, but for you system call means what I would
call command or shell command."
--tom
--
I forgot what it was like to be a tester...
If you have a conscience, it's not easy
-- Dean Roehrich, soon after coming back from Marketing
------------------------------
Date: Thu, 29 Jul 1999 13:21:37 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: Why this not work HELP!
Message-Id: <37a05504.6117986@news.inet.co.th>
give:
%HASH = ( "k" => [1,2,3] );
$x = $HASH{ "k" }-> [1]++;
print $x;
...... the result is "2" but i expect "3";...... why this not work !?
------------------------------
Date: Thu, 29 Jul 1999 19:08:27 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Why this not work HELP!
Message-Id: <7nqqjk$oo01@news.cyber.net.pk>
: %HASH = ( "k" => [1,2,3] );
:
: $x = $HASH{ "k" }-> [1]++;
:
: print $x;
:
: ...... the result is "2" but i expect "3";...... why this not work !?
$x = ++$HASH{ "k" } ->[1];
It is incremented _after_ it is assigned to $x.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". 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 V9 Issue 296
*************************************