[11110] in Perl-Users-Digest
Perl-Users Digest, Issue: 4710 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 21 11:06:10 1999
Date: Thu, 21 Jan 99 08:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 21 Jan 1999 Volume: 8 Number: 4710
Today's topics:
** Seems Like a Natural for Perl ** (David W. Bourgoyne)
Re: chat2.pl and Solaris? (Matthew Bafford)
context prob: assign @rowarray to 3d $table[@row],[$cur <mark.c.hamlin@bt.com>
dereference entire array of array references techmatt@my-dejanews.com
Re: Difficult issues not suitable for this newsgroup? (Randal L. Schwartz)
glob "toggle" behaviour (urgent!) <Claudio.Strizzolo@trieste.infn.it>
handling STDERR in open() <agianni@acsu.buffalo.edu>
Re: handling STDERR in open() <Alex.Davies@tiuk.ti.com>
Re: Help getting script going KernelKlink@webtv.net
Help with RE for separate Perl codes and comments <016781c@acadiau.ca>
Re: How do I use modules? <njones@firstquadrant.com>
Re: Including a CGI script in a Web Page KernelKlink@webtv.net
large data arrays Eadmund@writeme.com
Re: location of the faq (was append to beginning) (I R A Aggie)
Re: location of the faq (was append to beginning) <newsposter@cthulhu.demon.nl>
Re: Looking for free Web Server with CGI <Stefan.Mueller@ruhr-uni-bochum.de>
Re: pattern matching trouble <cdkaiser@delete.these.four.words.concentric.net>
Re: Perl Calendar and Publishing Script... webmaster@lifesprings.net
Re: Perl Criticism droby@copyright.com
Perl script running on SSL can't interface w/non-SSL se <frisk@enter.net>
Re: Perl Y2K compliance dave@mag-sol.com
Running a SQL query from a Perl CGI program <prabha@tek-tools.com>
Script for Alpha Pager Notification (Richard Nimz)
Re: Seeking a Book on (MS) SQL w/ perl <sammut@pipeline.com>
Re: Shared Memory Question: Why no separate attach? (Ex <njones@firstquadrant.com>
Simple CGI with Perl <C.N.Yeates@cs.cf.ac.uk>
Re: Status of Threaded Perl (Fluffy)
Sybase module for perl from CPAN (Christian M. Aranda)
Time in Perl <info@netstyle.nl>
Re: Time in Perl <Tony.Curtis+usenet@vcpc.univie.ac.at>
Ubiquitous Script (Emmanuel M. Dicarie)
Re: Ubiquitous Script (I R A Aggie)
Re: Yet another basic question. <no_spam@no_spam.com>
Re: Yet another basic question. <no_spam@no_spam.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Jan 1999 08:56:56 -0500
From: david.bourgoyne@bigfoot.com (David W. Bourgoyne)
Subject: ** Seems Like a Natural for Perl **
Message-Id: <yz2vhi0hgpj.fsf@marlin.i-have-a-misconfigured-system-so-shoot-me>
Here's the situation. Everyone at my household has a unique email
address at a mail forwarding service. All emails get forwarded to my
single ISP account. I would like to develop a POP3 Client that sucks
all the email off the ISP, looks at the To: fields and appends it to the
correct persons mbox. Also, I would like the POP3 Client to
automatically respond (send email back to the Sender) to image request.
Seems Like a Natural for Perl!!!
I was going to use the following modules:
POP3Client - for popping the mail.
MailFolder - for writing the mbox files.
MIME-tools - for constructing the reply to an image request and
inserting the image into the outgoing email.
MailFolder looks old, is there a better module for writing the mbox
file? Is this a good approach? Do I need any other modules? Any and all
comments are most welcome.
Regards,
David
------------------------------
Date: Thu, 21 Jan 1999 13:59:52 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: chat2.pl and Solaris?
Message-Id: <slrn7aecgl.1eg.dragons@Server.Network>
On 21 Jan 1999 00:59:28 -0500, in article <<x7ogntupxb.fsf@home.sysarch.com>>,
Uri Guttman <uri@home.sysarch.com> wrote:
=> >>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
[snip]
=> RLS> [extra bonus points if you can tell me what the other thing is!]
=>
=> cd /usr/local/lib/perl5
=>
=> grep Schwartz * */*
=>
=> CPAN.pm: Author MERLYN (Randal L. Schwartz)
[snip]
=> looks like chat2.pl is still in 5.005_02. you also claim to have written
=> CPAN.pm as well as dumpvar.pl.
And, when you look in CPAN.pm, you see:
cpan> a /and.*rt/
Author ANDYD (Andy Dougherty)
Author MERLYN (Randal L. Schwartz)
:)
[snip]
=> uri
--Matthew
------------------------------
Date: Thu, 21 Jan 1999 15:23:54 +0000
From: Mark Hamlin <mark.c.hamlin@bt.com>
Subject: context prob: assign @rowarray to 3d $table[@row],[$cursor]
Message-Id: <36A7468A.8272DF37@bt.com>
My problem is probably something to do with scalar/ array context.
Whats wrong with:
$table[@row][$cursor] = @next_row_returned_ from_db_select_query
or like this:
$table{@row,$cursor} = @next_row_returned_ from_db_select_query
???? What is the correct syntax. Must I define the array first?
I need to to this because DBI assigns the current row returned from a db select
query in a @array. I want to store all the rows returned in a table for
processing.
Please could you cc a direct response to me. Many thanks,
Mark Hamlin.
UK (144) 01473 646703
--
___....-----'---'-----....___
=========================================
___'---..._______...---'___
(___) _|_|_|_ (___)
\\____.-'_.---._'-.____//
~~~~'.__'---'__.'~~~~
~~~~~~~
'More speed'
Sisco
Work: mailto:mark.c.hamlin@bt.com
Personal: mailto:mark@dimitrinet.demon.co.uk
Please use you auto reply where possible to distribute to both mailboxes.
------------------------------
Date: Thu, 21 Jan 1999 15:25:20 GMT
From: techmatt@my-dejanews.com
Subject: dereference entire array of array references
Message-Id: <787gsi$l8d$1@nnrp1.dejanews.com>
I am using a function that returns an array of references to arrays.
example: @results = foo (@input);
Each element of the array is a reference to an array which contains the
results. I have no problem dereferencing on element at a time. example:
@array0 = ${$results[0]}; @array1 = ${$results[1]}; etc. The problem is
that I think there must be some elegant way of doing the assignment all on
one line (without using a loop). Something like this:
(@array1,@array2,@array3) = @{[@results]};
But this doesn't work. Is there any way to dereference the entire array in
one fell swoop?
Matthew Schaffner
real email address: techmatt@home.net
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 21 Jan 1999 07:49:28 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Difficult issues not suitable for this newsgroup?
Message-Id: <m14spkocc7.fsf@halfdome.holdit.com>
[editors note: we found the following in a remailer queue, and couldn't
tell whether it was a mailing or a posting, so we posted it. - ed]
>>>>> "Jonathan" == Jonathan Stowe <gellyfish@btinternet.com> writes:
Jonathan> I honestly dont think that there is some 'third force' in
Jonathan> this group that can have the power to decide whether your
Jonathan> previous contributions merit your getting an answer to a
Jonathan> question - even if it were possible which it isnt.
Thanks Jonathan for not telling him about our secret "Usenet Cabal".
After all, if word got out, we'd all be in serious trouble. Your
misdirection and misinformation should do the trick.
By the way, I notice you haven't paid your past-due dues yet. Better
hurry, or we'll blank your brain of your past five years participation
in the Cabal faster than you can say "M.I.B.".
Randal, Usenet Cabal member # 02134
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 21 Jan 1999 08:55:25 +0100
From: Claudio Strizzolo <Claudio.Strizzolo@trieste.infn.it>
Subject: glob "toggle" behaviour (urgent!)
Message-Id: <36A6DD6D.41C6@trieste.infn.it>
Hi all,
I have a strange problem with a small script using glob
on a Unix machine.
When running glob to expand a filepath for a number of times, it
seems to work the first time, but it returns null on the second
one; then it works again the third one, but not the fourth, and
so on.
Here is the script:
#!/usr/local/bin/perl
for ($i=0; $i<5; $i++) {
printf("=========== %d ===========\n",$i);
$file=glob("~myname/myfile");
printf("%s",qx{ls -la $file});
}
(BTW, maybe the "printf" line is not such a good programming
example, but I put it there just for a test. The same behaviour
applies for anything I try to do with $file. The problem is in
"glob")
Here is what I get when I run it:
# pluto.pl
=========== 0 ===========
-rw-rw-r-- 1 strizzol users 81 Jan 20 15:05 /usr/users/myname/myfile
=========== 1 ===========
total 42
=========== 2 ===========
-rw-rw-r-- 1 strizzol users 81 Jan 20 15:05 /usr/users/myname/myfile
=========== 3 ===========
total 42
=========== 4 ===========
-rw-rw-r-- 1 strizzol users 81 Jan 20 15:05 /usr/users/myname/myfile
Is there any workaround?
BTW, I need a solution for a larger urgent project. If possible, please
send me any reply through e-mail too.
Thank you very very much in advance
Claudio
------------------------------
Date: Thu, 21 Jan 1999 09:23:16 -0500
From: Andrew S Gianni <agianni@acsu.buffalo.edu>
Subject: handling STDERR in open()
Message-Id: <36A73854.699CDE90@buffalo.edu>
I'm using open to access the output of a system call:
open(SESAME, "system_call -foo |");
and the call kicks some stuff out the standard error which I want to
capture and dump. However, I can't just do:
open(SESAME, "system_call -foo |&");
Because that seems to just fork a process and SESAME never gets the
output of the system call. Any hints on dealing with this? Maybe using
open isn't the best way to get the output from this call? (I wouldn't be
surprised)
Andrew
--
Andrew Gianni - Developer "You are about to be told one
UNIX Guy/Juggler Extraordinaire more time that you are America's
SUNY at Buffalo ACS/CIT most valuable natural resource...
ph:(716)645-3587x7009 Have you seen what they do to
fx:(716)645-3588 valuable natural resources?"
agianni@buffalo.edu -Utah Phillips
http://www.cs.buffalo.edu/~agianni/
------------------------------
Date: Thu, 21 Jan 1999 14:40:52 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
To: Andrew S Gianni <agianni@acsu.buffalo.edu>
Subject: Re: handling STDERR in open()
Message-Id: <36A73C73.F581E56E@tiuk.ti.com>
Andrew S Gianni wrote:
> I'm using open to access the output of a system call:
>
> open(SESAME, "system_call -foo |");
>
> and the call kicks some stuff out the standard error which I want to
> capture and dump. However, I can't just do:
>
> open(SESAME, "system_call -foo |&");
>
Try:
open(SESAME, "system_call -foo 2>&1|")
|| die "can't open - $!\n";
HTH.
alex.
> Because that seems to just fork a process and SESAME never gets the
> output of the system call. Any hints on dealing with this? Maybe using
> open isn't the best way to get the output from this call? (I wouldn't be
> surprised)
>
> Andrew
> --
> Andrew Gianni - Developer "You are about to be told one
> UNIX Guy/Juggler Extraordinaire more time that you are America's
> SUNY at Buffalo ACS/CIT most valuable natural resource...
> ph:(716)645-3587x7009 Have you seen what they do to
> fx:(716)645-3588 valuable natural resources?"
> agianni@buffalo.edu -Utah Phillips
> http://www.cs.buffalo.edu/~agianni/
------------------------------
Date: Thu, 21 Jan 1999 08:15:25 -0500 (EST)
From: KernelKlink@webtv.net
Subject: Re: Help getting script going
Message-Id: <4157-36A7286D-4@newsd-104.iap.bryant.webtv.net>
Also, what did you set the permissions to on the script and the folder
that it is in?
------------------------------
Date: Thu, 21 Jan 1999 10:44:30 -0400
From: Jerry Chen <016781c@acadiau.ca>
Subject: Help with RE for separate Perl codes and comments
Message-Id: <36A73D4E.B38A7917@acadiau.ca>
Hi,
I have some difficulties to parse Perl code to identify
the source part and comment part using
regular expression. From searching the Dejanews archive,
I know that it is difficult to separate codes with comments.
However, I do not need to be 100% accurate. Something close
will be ok.
Any helps are appreciated.
Thanks,
Jerry
------------------------------
Date: Thu, 21 Jan 1999 06:55:01 -0800
From: Neil Jones <njones@firstquadrant.com>
To: Chris <chrisl@hamptons.com>
Subject: Re: How do I use modules?
Message-Id: <36A73FC5.22C97E39@firstquadrant.com>
Chris wrote:
> I haven't used Perl since Perl 4, and I don't have a clue about using
> modules.
The 2nd edition of the camel book describes them pretty well.
If that fails, try "Learning Perl" (it has changed substantially since
Perl 4, so is worth a bit of relearning). Besides, you did 1/2 of the
work right there: "use <module>;"
> I couldn't actually get a hold of CGI.pm, and
perl -MCPAN -e "install CGI"
and away you go. Also, I'm sure it's in the FAQ somewhere. It can
also be downloaded and made by hand.
..Neil
------------------------------
Date: Thu, 21 Jan 1999 08:25:44 -0500 (EST)
From: KernelKlink@webtv.net
Subject: Re: Including a CGI script in a Web Page
Message-Id: <4158-36A72AD8-1@newsd-104.iap.bryant.webtv.net>
For excellent CGI tutorial on virtual includes try
http:/www.hiway.com/support then choose "Server-Side Includes".
------------------------------
Date: Thu, 21 Jan 1999 13:59:13 GMT
From: Eadmund@writeme.com
Subject: large data arrays
Message-Id: <787brc$gnm$1@nnrp1.dejanews.com>
Hi all,
I have a web page that requires a lot of data (an address book) to be
passed from the web server to the client page and back again. Sending it from
the server is easy enough, but does anyone know a good way to pass it back?
Think about this please before answering 'A Form' etc. We are talking a lot
of data (up to 100 addresses). I can preprocess any data via a java script.
Ideally, what I need to know is, is there a way to pass an array back to the
server. If you know, please could you give an example. Also, please don't
reply to this post with generic pointers to cgi/javascript librarys.
Thanks in advance for replying
EAmund
Eadmund@writeme.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 21 Jan 1999 09:35:34 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: location of the faq (was append to beginning)
Message-Id: <fl_aggie-2101990935340001@aggie.coaps.fsu.edu>
In article <786ul7$6t5$1@reader1.reader.news.ozemail.net>, "bill"
<bm@howcoolaremp3s.com> wrote:
+ wow two responses and not one answers the question that the guy was looking
+ for.......
The answers so far have been adequate for someone sufficiently motivated
to look for it. That's to say: anyone clueful enough to try perl should be
clueful enough to try DejaNews.
James
------------------------------
Date: Thu, 21 Jan 1999 10:27:12 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: location of the faq (was append to beginning)
Message-Id: <36A7474F.7EB29BCD@cthulhu.demon.nl>
bill wrote:
> Erik van Roode wrote in message <36A6032B.C76F4D06@cthulhu.demon.nl>...
> >"Ronnie D. Jewell" wrote:
> >
> >> For future reference; where do I find a copy of the FAQ everyone
> >> mentioned?
> >
> >Read the '[Perl] How to find the Perl FAQ' message that gets posted
> >regularly.
>
> wow two responses and not one answers the question that the guy was looking
> for.......
>
> I dont know where it is myself, so sorry cant help you although I do know
> its somewhere on the internet....... :-)
Wow, that's a useful response ...
The message I referred to was posted Tuesday at 6:26 am. The question
where to find the FAQ was posted Tuesday at 7:36 pm. A simple search
on the subject of the message I mentioned is all that it takes to
find, and if your newsreader does not have that option, I suggest
getting another one. Do you expect me to reply with the entire message
included?
--
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely. And everyone who owns a car intends that it be used as a
portable dumpster. Any unwanted garbage in their vehicle they can
simply throw away, after all.
------------------------------
Date: Thu, 21 Jan 1999 15:03:59 +0100
From: Stefan Mueller <Stefan.Mueller@ruhr-uni-bochum.de>
To: Chris <chrisl@hamptons.com>
Subject: Re: Looking for free Web Server with CGI
Message-Id: <36A733CF.5831@ruhr-uni-bochum.de>
Chris wrote:
>
> Hi
>
> Are there any free Web servers for Win98 (even trial versions) that
> allow me to mess around with CGI & Perl? Last time I tried this (years
> ago), PWS was supposed to do it but it was broken (or I was broken, or
> something)
Try apache. There're binaries available on www.apache.org
And get perl from www.activestate.com.
It works fine for me.
Stefan.
--------------------------------------------
Dipl.-Ing. Stefan Mueller
Ruhr-University Bochum
AG f. num. Meth. i.d. Mechanik und
Simulationstechnik
Germany
--------------------------------------------
------------------------------
Date: 21 Jan 1999 07:21:42 PST
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: pattern matching trouble
Message-Id: <787gm6$sdv@chronicle.concentric.net>
Xavier Cousin <cousin@ensam.inra.fr> writes:
>Hello, i've got a pattern matching trouble in a perl script, here is an
>piece of the code dealing with the pattern matching :
You give your sample and your code, but you don't say what kind of output
you're expecting. I don't understand what you're trying to do.
--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
-- supporting the Commodore 64/128: http://www.armory.com/~spectre/cwi/ --
head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"
------------------------------
Date: Thu, 21 Jan 1999 14:36:13 GMT
From: webmaster@lifesprings.net
Subject: Re: Perl Calendar and Publishing Script...
Message-Id: <787e0r$ikc$1@nnrp1.dejanews.com>
Try looking at cgi-resources.com under perl.
There's a lot of programs that do what you're
requesting. PerlCal is a good calendar. NewsUpdate
is a good posting articles script. If those don't
work for you, let me know. I've written a script
that i use at lifesprings-resources.com to post
articles and announcements.
In article <
783l6m$a2m$1@nnrp2.dejanews.com>,
tybee@my-dejanews.com wrote:
> Hiya,
>
> I'm still learning Perl and using it on my website, I have been looking for a
> decent Calendar CGI that allows additions, editing, etc. online, anyone have
> any suggestions?
>
> Also, I have been trying to find a script that allows you to publish online,
> making an html page on the fly as it were and saving it on the server to be
> viewed, etc.
>
> Thanks for any input.
>
> Patrick :)
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 21 Jan 1999 14:46:15 GMT
From: droby@copyright.com
Subject: Re: Perl Criticism
Message-Id: <787ejj$j61$1@nnrp1.dejanews.com>
In article <783lia$b21$1@nnrp1.dejanews.com>,
topmind@technologist.com wrote:
>
> I asked for examples from yous of indespensable Perl cryptology
> and nobody showed any. Unless you produce some Uri, you are
> a hypocrite.
>
Uri has produced plenty of code. I've seen lots of it posted here. It's
generally quite intelligible to us, but to you would probably qualify as
cryptology. I suggest you find some and show us how you would improve it.
I.e., show us some real code with the faults you allege and show us how to do
it right.
Or just go away.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 21 Jan 1999 10:23:03 -0500
From: "Donna M. Forosisky" <frisk@enter.net>
Subject: Perl script running on SSL can't interface w/non-SSL server
Message-Id: <36A74657.9420DDC@enter.net>
Hello,
Here's the situation : I have a perl script running on a secure server
which needs to ask an insecure script on a different machine for a bit
of info. As soon as I get to the point where the connection is made to
the insecure server, the program stops.
Reason I'm doing this? UPS provides a "quick calculator" interface to a
cgi script which accepts among other things, the weight of what you want
shipped, how you want it shipped, ship from zip code and ship to zip.
The users zip code is obtained on the same form where they provide their
CC# info, etc. so it must be secure. The script which processes the
"biographical" info, for lack of a better term, uses perl's LWP library
to make a connection to UPS.com's "quick calculator" prior to returning
a final "receipt" with shipping information as well as other data.
If I run the scripts from an insecure server, everything works fine --
UPS returns to me an actual shipping cost. However, when I run this the
way it is supposed to be run, via secure server, the script halts
without an error or message at the point where the insecure connection
is made.
So my question is, can I find a way to do what I want to do? Can I take
info from a form submitted on a secure server and have it interface with
an insecure server? As far as I can tell, UPS does not provide a secure
connection and even if it did, I'm not sure this approach would work
either.
I can understand the logic in preventing this mix of secure &
insecure... I just don't know what the best solution is...
Any suggestions would be very much appreciated.
Donna
------------------------------
Date: Thu, 21 Jan 1999 14:07:16 GMT
From: dave@mag-sol.com
Subject: Re: Perl Y2K compliance
Message-Id: <787cac$h0i$1@nnrp1.dejanews.com>
In article <36A68C1D.B10B0D90@starnetinc.com>,
Ted Hajduk <thajduk@starnetinc.com> wrote:
> Hi,
>
> Excuse me if this has already been discussed elsewhere, but can anyone
> point me to information on Perl Y2K compliance - interpreter, modules,
> etc?
>
> I was asked this by the Y2K coordinators at our company and I have been
> unable to find any information in the usual places.
Does 'the usual places' include perldoc perlfaq4, which contains the question
'Does Perl have a year 2000 problem?' (along with its answer!)
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 21 Jan 1999 14:03:08 GMT
From: Prabha Krishnan <prabha@tek-tools.com>
Subject: Running a SQL query from a Perl CGI program
Message-Id: <36A73416.CCE54AE8@tek-tools.com>
System setup : Apache 1.2.5
Database : Oracle 8.0.5 on Red Hat Linux 5.1
I am a beginner to perl.
I have a perl script that needs to run a query against an Oracle
database. When i run this from the command line, it runs fine. But, when
i call this script as a CGI from the browser, I donot get any results
back. I am not sure what is happening. Attached is the perl script.
Any help would be appreciated.
Please reply to padhu@yahoo.com
Thanks,
Prabha.
#!/usr/bin/perl
#
# This is the environment needed for sqlplus to run.
# NOTE: Even this info can be read in from a file.
#
$ENV{'ORACLE_SID'}="TEK1";
$ENV{'ORACLE_HOME'}="/home/oracle/product/8.0.5";
$ENV{'PATH'}="$ENV{'PATH'}:/home/oracle/product/8.0.5/bin";
$ORACLE_SID="TEK1";
$ORACLE_HOME="/home/oracle/product/8.0.5";
open(SHELLFILE, ">/tmp/$$.sh");
print SHELLFILE <<SHELL_SCRIPT;
ORACLE_SID=TEK1
ORACLE_HOME=/home/oracle/product/8.0.5
$ORACLE_HOME/bin/sqlplus -s tektools/tektools\@tek1.world > /tmp/$$.log
<< END
set heading off
select count(*) from productbugs;
exit
SHELL_SCRIPT
close(SHELLFILE);
system("chmod +x /tmp/$$.sh");
system("/tmp/$$.sh");
#
# This is the part that generates the order id. You might need to pass
in the
# product name or product id to the SQL file. The SQl file will append
this
# info to the unique sequence no and return the orderid.
#
#$sqloutput=`/home/httpd/cgi-bin/test.sh`;
#system("/home/httpd/cgi-bin/test.sh > /tmp/$$.log");
#
# Here we need to read the log file and read in our order-id
#
open(FILE, "/tmp/$$.log") || die "Log file does not exist.\n";
while ( $newline = <FILE> )
{
if ( $newline =~ /^$/ ) { next; }
@vals = split(' ',$newline);
}
close(FILE);
#
# Remove the shell and log file after reading
#
system("rm -f /tmp/$$.sh");
system("rm -f /tmp/$$.log");
$sqloutput = $newline;
print "Content-type: text/html\n";
print "\n";
print "<html>\n";
print "<body>\n";
print "<h2>$vals[0]</h2>\n";
print "$sqloutput<br>";
print `date`;
print "</body>\n";
print "</html>\n";
------------------------------
Date: Thu, 21 Jan 1999 08:58:31 -0600
From: rnimz@onramp.net (Richard Nimz)
Subject: Script for Alpha Pager Notification
Message-Id: <MPG.1110fc947763aa13989680@news.onramp.net>
I suspect I'm hung up on a syntactical problem - I tend to use perl in
bursts, so I don't keep very sharp on syntax.
What I'm trying to do is have a script that can be run from the command
prompt by misc. applications (network monitors, backup monitors, etc.) to
page me when a "significant" event occurs.
The trigger mechanism, I'm not worried about. What I'm having trouble
with is getting this script, pager.pl, to push the PIN and message down
to the web page that fires off the page.
Any help would be greatly appreciated.
Thanks,
Richard
Here's the code:
# Perl Module to automatically send informational pages to Net Admin
# Richard Nimz
# Jan-20-1999
{
use strict;
my $PINo;
my $Messg;
my $output;
my $out;
my $appath;
my $webpath;
$PINo = "**********";
$Messg = "This is a test message from your workstation";
$Messg = substr($Messg,0,199);
$output = "";
($out = $_);
$output .= "\&PIN=$PINo\n";
($out = $_);
$output .= "\&MSSG=$Messg\n";
($out = $_);
$output .= "\&Q1=1\n";
$appath = "D:\\Program Files\\Plus!\\Microsoft Internet\\IEXPLORE.EXE";
$webpath = "http://www.mobilecomm.com/cgi-bin/wwwpage.exe";
open (APAGE,"| $appath $webpath");
print APAGE ($output);
close (APAGE);
}
------------------------------
Date: Thu, 21 Jan 1999 10:16:35 -0500
From: "Michael" <sammut@pipeline.com>
Subject: Re: Seeking a Book on (MS) SQL w/ perl
Message-Id: <787gov$6jp$1@samsara0.mindspring.com>
I would be curious to know these resources as well
>Help! I am looking for a book to help me learn to use SQL with
>Perl 5. I have a number of scripts using a flat-file system that
>I'm going to be porting to an MS SQL server for better
>reliability & speed. Any suggestions for books and/or websites
>would be great! Please reply to my email address.
>
>Thanks in advance.
>
>--Carl M.
>
>
------------------------------
Date: Thu, 21 Jan 1999 07:16:09 -0800
From: Neil Jones <njones@firstquadrant.com>
Subject: Re: Shared Memory Question: Why no separate attach? (Expert)
Message-Id: <36A744B9.40B10C0F@firstquadrant.com>
Try out IPC::Shareable...it works pretty well for me (but it may not be
suitable
for your needs). Maybe mmap? I wasn't able to find an IPC module that
used Mmap, though, except Apache::Mmap.
..Neil
rkc@ll.mit.edu wrote:
> I am writing a perl application that is communicating with another
> process via shared memory. In perl, the shmread operation combines
> attaching, reading, and detatching all into one operation. Since we'll
> be pushing alot of data back and forth, I don't want to incur the cost
> of all of those kernel operations. Is there a strong reason why I
> shouldn't write a C module that has separate attach, read/write, and
> detach operations? (e.g., does this mess up some perl memory internals?)
>
> If I can't do this, then what is the recommended perl IPC for Unix systems?
>
> Thanks for your help,
>
> Rob
> --
> Dr. Robert K. Cunningham Information System Technology Group
> rkc@ll.mit.edu MIT Lincoln Laboratory
> *** My comments, my opinions: my responsibility.
------------------------------
Date: Thu, 21 Jan 1999 15:30:44 -0000
From: "Chris Yeates" <C.N.Yeates@cs.cf.ac.uk>
Subject: Simple CGI with Perl
Message-Id: <787h76$o7n$1@fafnir.cf.ac.uk>
I am just embarking on a project to produce web pages with multiple choice
tests at the end of each section. Does anybody know how I can write a CGI
script to mark the tests and prevent access to the next section to those
failing to achieve a high enough mark. ie 8 out of 10.
Cheers
C.N.Yeates@cs.cf.ac.uk
------------------------------
Date: 21 Jan 1999 15:23:13 GMT
From: meowing@banet.net (Fluffy)
Subject: Re: Status of Threaded Perl
Message-Id: <787gon$fig@meow.invalid>
Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
> No, it's completely unreliable. use Thread; is a surefire
> way to turn your perl interpreter into an Insta-Matic Core
> File Generator (it slices, it dices, it makes thousands of
> julienne silicon wafers :-).
Then I'll have to tell the nntp daemon I'm reading this article through
that it shouldn't have been running for over 2 days. It's worth noting
that if your underlying thread library is unstable (and quite a few
are), perl's not going to be very happy. (I've had individual threads
in the process die, but those are problems in the INN library that I
can reproduce in plain single-threaded C.)
> > What works in one
> > release may or may not work the same way in the next.
>
> No, what does coredump in one release may not in the next.
One of the problems right now is that variables which shouldn't be
in scope, are. If you mess with things you can touch right now but
shouldn't, it'll ruin your day. Don't do that, and it's much more
happy.
> If you want to play with threads you will be happier with _5x than
> with _0x (you're more likely to see fixes show up in the dev branch
> than in the maint).
That isn't necessarily true. 5.005_54 leaks a *lot* of memory when the
Threads module is in there. 5.005_03-pre doesn't. That's because _03
is several weeks newer than _54 so it's already got lots of the
patches one can expect to see in _55.
I'll take running code over FUD any day. Thanks, drive through.
--
"Meow." --me
------------------------------
Date: Thu, 21 Jan 1999 15:50:34 GMT
From: christian.arandaNOSPAM@NOSPAMiiginc.com (Christian M. Aranda)
Subject: Sybase module for perl from CPAN
Message-Id: <787hrh$2qm$1@news-2.news.gte.net>
Folks -
I'm looking for the Sybase module for perl on CPAN but can't seem to
come up with it.
I don't use CPAN as much as I should, and hence don't know how to find
such things on CPAN.
Any assistance is appreciated, however I will be searching instead of
just waiting for answers.
TIA
------------------------------
Date: Fri, 22 Jan 1999 15:49:24 +0100
From: "news.cistron.nl" <info@netstyle.nl>
Subject: Time in Perl
Message-Id: <787evk$ur4$1@enterprise.cistron.nl>
I am trying to write a script, using Perl, for windows32 systems.
I would like to know how to get the date and time in a variable as text.
I need a variable $dt to get the date and time from the local server and
formatted like this:
thu, jan. 22nd, 1999 - 15:48
ofcourse I want the real time in $dt whenever I run the perl-script.
Thanks a lot in advance!
Michel
------------------------------
Date: 21 Jan 1999 15:56:07 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Time in Perl
Message-Id: <83sod4fzeg.fsf@vcpc.univie.ac.at>
Re: Time in Perl, news <info@netstyle.nl> said:
news> I am trying to write a script, using Perl, for
news> windows32 systems. I would like to know how
news> to get the date and time in a variable as
news> text. I need a variable $dt to get the date
news> and time from the local server and formatted
news> like this:
news> thu, jan. 22nd, 1999 - 15:48
news> ofcourse I want the real time in $dt whenever
news> I run the perl-script.
perldoc -f localtime
perldoc -f time
perldoc POSIX (for strftime, assuming Win32 has POSIX)
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Thu, 21 Jan 1999 09:38:09 -0500
From: validAddress@at.TheEndOfMessage (Emmanuel M. Dicarie)
Subject: Ubiquitous Script
Message-Id: <validAddress-2101990938100001@dialup-574.hip.cam.org>
Hello,
I'm trying to figure out a way to do the following and looking for
pointers on this question. I'm using the korn shell on a ISP account.
Imagine that I have a "processFiles" script that process every files in a
directory and print the result. The script is in /home/emmanuel/libPerl/.
The script take for param the name of a directory. So I can do something
like this: processFiles /home/emmanuel/oneDirectory/
Now I want to be able to call this script from any directory without
having to prefix it with its current directory (~/libPerl/processFiles or
/home/emmanuel/libPerl/processFiles), and be able to pass to this script
the current directory I'm in without having to write the current whole
path.
My questions are :
1) Is there a way to call a scrip from anywhere without specifying where
the script reside?
I guess (I didn't try this yet) I can call this script with a shell alias
or a shell function and write this alias/function in my .profile file.
But maybe there is a more perlish way (maybe something like including the
path to the script in my PERL5LIB that is exported to my %ENV every time I
log in my account).
2) Also, instead of giving as parameter to my script a whole path to the
directory where I want to process the files, is it possible to do
something like
processFiles pwd ?
TIA
-Emmanuel
--
Emmanuel
EMAIL => emm*cam.org
To email me, please replace "*" by "@"
------------------------------
Date: Thu, 21 Jan 1999 10:44:42 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Ubiquitous Script
Message-Id: <fl_aggie-2101991044420001@aggie.coaps.fsu.edu>
In article <validAddress-2101990938100001@dialup-574.hip.cam.org>,
validAddress@at.TheEndOfMessage (Emmanuel M. Dicarie) wrote:
+ 1) Is there a way to call a scrip from anywhere without specifying where
+ the script reside?
Yes. This is a unix question, to. Place the script in your path
('echo $PATH'), and it will be available. Depending on the shell,
it will either be available immediately, or when you login again
or rehash/hash[*] your current shell.
James
[*] I use zsh, and its man page sez:
rehash [ -df ]
Throw out the command hash table and start over. If
the -f option is set, rescan the command path
immediately, instead of rebuilding the hash table
incrementally.
rehash is equivalent to hash -r.
------------------------------
Date: Thu, 21 Jan 1999 08:28:47 -0600
From: "Ban Spam Now" <no_spam@no_spam.com>
Subject: Re: Yet another basic question.
Message-Id: <787dl9$m5c@dfw-ixnews4.ix.netcom.com>
Is there also a way to d this with system(), also, is it possible to
transform the return code into it's "real" number?
Abraham Grief wrote in message ...
>
>The following program stores the output of another program named
>'kshscript' and then prints the output and the exit status.
>According to the camel book, the exit status of a child process
>is $? >> 8 because the lower order bits contain other info, in the
>same format as the status returned by wait(2).
>
>!/usr/bin/perl -w
>open(INPUT, 'kshscript |');
>my @kshOutput = <INPUT>;
>close(INPUT);
>print @kshOutput;
>printf "exit status: %i\n", $? >> 8;
>
> - abey@cs.ucr.edu
>
>
>On Thu, 21 Jan 1999, Ban Spam Now wrote:
>
>> Is there any way to run an external ksh script, store the output in one
Perl
>> variable and the return code in another Perl variable. Does Perl work in
>> such a way that the return code you get back will be the same as $? ?
>>
>>
>> Thanks again.
>>
>>
>>
>>
>>
>>
>
------------------------------
Date: Thu, 21 Jan 1999 08:41:39 -0600
From: "Ban Spam Now" <no_spam@no_spam.com>
Subject: Re: Yet another basic question.
Message-Id: <787edc$ml2@dfw-ixnews4.ix.netcom.com>
Hmm... I had a problem with this. There was no output in my @kshoutput and
the return code was always 0, even when I created script errors and checked
it was producing output.
Abraham Grief wrote in message ...
>
>The following program stores the output of another program named
>'kshscript' and then prints the output and the exit status.
>According to the camel book, the exit status of a child process
>is $? >> 8 because the lower order bits contain other info, in the
>same format as the status returned by wait(2).
>
>!/usr/bin/perl -w
>open(INPUT, 'kshscript |');
>my @kshOutput = <INPUT>;
>close(INPUT);
>print @kshOutput;
>printf "exit status: %i\n", $? >> 8;
>
> - abey@cs.ucr.edu
>
>
>On Thu, 21 Jan 1999, Ban Spam Now wrote:
>
>> Is there any way to run an external ksh script, store the output in one
Perl
>> variable and the return code in another Perl variable. Does Perl work in
>> such a way that the return code you get back will be the same as $? ?
>>
>>
>> Thanks again.
>>
>>
>>
>>
>>
>>
>
------------------------------
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 4710
**************************************