[13614] in Perl-Users-Digest
Perl-Users Digest, Issue: 1024 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 8 18:05:54 1999
Date: Fri, 8 Oct 1999 15:05:22 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <939420321-v9-i1024@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 8 Oct 1999 Volume: 9 Number: 1024
Today's topics:
Re: ActiveState Perl install error on Win/NT 4.0 sp3 mkx@excite.com
Re: Backtick programs <bernie@fantasyfarm.com>
Re: bug or feature? <dparrott@ford.com>
Re: Checking for processes schan6128@my-deja.com
Re: Converting from Decimal to Binary <sb@sdm.de>
Re: Delete a line in a file <cassell@mail.cor.epa.gov>
Re: formatting numbers (Abigail)
Re: formatting numbers <arthur.haas@westgeo.com>
Re: formatting numbers <laurensmith@sprynet.com>
Re: formatting numbers <sariq@texas.net>
Re: formatting numbers (Clinton Pierce)
Re: Looking for Perl script to parse Ada code <cassell@mail.cor.epa.gov>
Re: Memory leak in assignment (Ilya Zakharevich)
Modifying file timestamps <caitchison@novell.com>
Re: Modifying file timestamps <caitchison@novell.com>
newbie possibly barking up the wrong tree... <Mike@blamires.karoo.co.uk>
Re: NEWBIE QUESTION ON ORACLE <g-preston1@ti.com>
Re: NEWBIE QUESTION ON ORACLE <emschwar@rmi.net>
Re: NEWBIE QUESTION ON ORACLE <emschwar@rmi.net>
Re: NEWBIE QUESTION ON ORACLE <g-preston1@ti.com>
Re: NEWBIE QUESTION ON ORACLE <makkulka@cisco.com>
Re: NEWBIE QUESTION ON ORACLE <kperrier@blkbox.com>
Re: parenthesizing arguments to grep - BLOCK form <uri@sysarch.com>
Re: parenthesizing arguments to grep - BLOCK form jrw32982@my-deja.com
Re: Question about alarm and run away processes <cassell@mail.cor.epa.gov>
Re: Sending mail with Perl? <cassell@mail.cor.epa.gov>
sendmail problem <robbertc@ping.be>
Re: Shell and Perl have different $? (Ilya Zakharevich)
Re: Upload problem w/ Apache/Linux/CGI.pm j_v_schmitt@my-deja.com
Re: What is THE book for PERL? <theglauber@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 08 Oct 1999 17:28:10 -0400
From: mkx@excite.com
Subject: Re: ActiveState Perl install error on Win/NT 4.0 sp3
Message-Id: <=V=+N7Yb7ulSWIXeORCy0MgI9UZf@4ax.com>
On Fri, 8 Oct 1999 22:03:00 +0100, "Duncan Mackinder"
<duncan@mackinder.demon.co.uk> wrote:
>I've been having trouble installing ActiveState Perl (versions 5.17, 5.19
>and 5.20) on Windows NT 4.0 Server SP3. I also have Visual Studio 6.0 + SP2
>installed in case this is relevant as I have seen other problems caused by
>Visual Studio. I can install 5.02 with no problems.
>
>During the install I accept all defaults, except directory (which I've set
>to D:\programfiles\perl), I have 84Mb free on C:, 143Mb on D: and 223Mb free
>on E: (which is where Windows NT is installed). After 'Start Copying Files'
>dialog window is displayed and I click Next on that dialog, I get a popup
>saying:
> Warning
> Error using perlez.dll!
>
>Then another saying:
> .\Could not load
>\P:\Apps\ActivePerl\temp\bin\MSWin32-x86-object\PerlEz.dll! ActivePerl
>installation will abort!
>
>The distribution appears to have unpacked itself OK to E:\temp and I can see
>the perlez.dll whilst the installer dialogs are being displayed.
>
>Has anyone seen this before or have any suggestions.
>
>Many thanks in advance for any help
>
>Duncan Mackinder
This may be overkill, but it is what fixed the same problem for me. It
started occurring after InstallShield failed in a previous attempt,
due to it's inability to work with path lengths greater than a certain
length (256 bytes?).
Uninstall ActivePerl. If the uninstaller will not work correctly,
delete the directory you have installed ActivePerl in deleting
config.pm or \lib directory may be sufficient.
Then rerun the ActivePerl installer. Make sure you uncheck the option
to include the \bin directory in the system path.
------------------------------
Date: Fri, 08 Oct 1999 16:21:05 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Backtick programs
Message-Id: <+07+N7cqpoqLPTmxQUZlfj9PsE4w@4ax.com>
oliver.cookIYAPCR@ukonline.co.uk wrote:
} I'm writing a program which needs to call several shell programs. To
} run them I use the following format:
}
} `command1`;
} `command2`;
}
} however, command2 is started as soon as command1 is. How can I make is
} to that command2 isn't started until command1 is finished?
I think you need to tell us more about your environment. The semantics of
perl are such that it *should*not* execute command2 until command1 has
completed, even doing so in a null context. [although I'll mention that it
is a bit odd instead of
`command1`;
the more usual form would be:
system (command1 >/dev/null) ;
Anyhow, the reason I say you need to tell us more is that at least on my
perl [5.004 on RH Linux] it doesn't do the commands at the same time at
all:
>>> `date >/dev/tty; sleep 30` ;
>>> `date >/dev/tty` ;
results in:
>>> Fri Oct 8 16:18:57 EDT 1999
>>> Fri Oct 8 16:19:27 EDT 1999
which is both what I would have expected and what you wanted. So if
you're getting command2 to execute before comman1 completes, something else
must be going on...
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Fri, 08 Oct 1999 13:09:18 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
Subject: Re: bug or feature?
Message-Id: <37FE253E.2FBD6DAC@ford.com>
Alexander Knack wrote:
>
> > > newbies almost never find a real bug in perl. so please don't credit
> > > yourself as doing that. you have run into a very common newbie bug in
> > > your own code. read perlre to learn more about why that split doesn't do
> > > what you expect.
>
> come on. just because i've forgot that split takes regex as first
> argument there
> is no need to blame me newbie.
hmmmm... the *best* answer I *ever* got for such questions was a finger
pointed at the bloody documentation. LEARNING TO APPLY ONESELF in the
service of SOLVING YOUR OWN PROBLEM is a valuble skill to possess. The
excoriated newbie should either say "thank you" for that advice or get
the hell out of the business -- we have far too many MickeySoft
'certified'
know-nothings wandering about spouting clueless acronyms instead of
making stuff that works.
> and, instead of notifying me about this, you attempt to trash the news
> with
> your emotional problems.
I have observed that Uri will go out of his way to help *serious* people
resolve issues. BUT -- you had better be able to demonstrate evidence
that you have at least attempted to do your homework.
Usenet discussions are not a substitute for RTFM!!!
--
-----------------------------------------------------------------------
Dennis M. Parrott | Unix: dparrott@ford.com
PCSE Webmaster | PROFS: DPARROTT
Ford Motor Company | VAX: EEE1::PARROTT
Dearborn, Michigan USA | public Internet: dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933 Fax: 313-248-1234 Pager: 313-851-2958
------------------------------
Date: Fri, 08 Oct 1999 21:07:10 GMT
From: schan6128@my-deja.com
Subject: Re: Checking for processes
Message-Id: <7tlmdk$6fp$1@nnrp1.deja.com>
>
> kill 0, $pid should do this, as documented in perlipc. If not,
> your Perl is broken.
>
> What platform are you on, and what version of Perl?
I am running perl on Windows NT. It is the active perl 5.19. Could it
be NT screwing things up?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Oct 1999 19:12:01 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Converting from Decimal to Binary
Message-Id: <7tlfm1$gqq$1@solti3.sdm.de>
In article <37FE3FA9.63B95E8@mail.cor.epa.gov>, David Cassell <cassell@mail.cor.epa.gov> wrote:
> [snip]
> > Suggestion for the perlfaq4 manpage:
> > ------------------------------------
> [snip]
> Steffen, you *did* send these to TomC at
> perlfaq-suggestions@perl.com already, right?
Yes, about 2 months ago, but I don't know if they have already made it
into the source tree of the pumpking holders...
> Okay, sorry for doubting you...
No problem. :-)
> David
Best regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Fri, 08 Oct 1999 12:11:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Delete a line in a file
Message-Id: <37FE41D7.ECE21FFB@mail.cor.epa.gov>
Ilya wrote:
[snip]
> >> That's why
> >> newsgrops exist to complement it.
>
> > No, newsgroups exist for other reasons.
>
> That's your personal opinion, thank you for sharing it.
It is not a personal opinion. Clearly you do not know that
much about Usenet or about newsgroups. But, since you have
read parts of the FAQ you have shown an ability to learn.
So you can find out.
Find out about the history of comp.lang.perl and why it
split into the comp.lang.perl.* hierarchy.
Find out about the *charter* for this newsgroup.
You'll see what this newsgroup was created to do.. and not do.
> Every person has his or her understanding of the newsgroup(s). There isn't
> some biblical principle regarding that. In short - if some people want to ask
> FAQ questions here, let them. If you don't like that - don't read it.
Does that mean that if I want to discuss my uncle's terrible
sciatica here, that's okay, because 'every person has his or
her understanding of the newsgroup(s)'? Of course not.
Every newsgroup has an origin and an intent, and is driven by
the frequent posters who count as 'regulars'. Look at a
group like rec.arts.tv.mst3k.misc for an example of this.
Then face the fact that you are wrong about the purpose of the
newsgroup. And move on. It's not worth getting into a
war over.
It seems that you're still ticked off because you wanted more
help than the FAQ supplied, and you didn't get it.. because
you didn't tell anyone you had read the FAQ when you asked a
FAQ, and hence didn't get the answers you expected. Well,
this isn't personal. It's just a bunch of bits and bytes.
Please don't make this into a one-man war against clpm. If
you want to be helpful, then feel free to give out Perl
advice to those in need. Just be aware that wrong answers
will be flamed, and weak answers will be corrected or im-
proved.. just like the answers from everyone else.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 8 Oct 1999 16:15:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: formatting numbers
Message-Id: <slrn7vsnmi.25u.abigail@alexandra.delanet.com>
inna raykhman (inna@raykhman.com) wrote on MMCCXXIX September MCMXCIII in
<URL:news:37FE5DA2.5E403DD9@raykhman.com>:
??
?? does anybody know of any module or perl function that would allow me to
?? format a string containing a number, you know insert comma's in all the
?? right places and things.
?? or, if someone, knows the reg.exp. off the top of their head (i hope
?? that's the correct phrase, it does sound weird.) anyway, that would be
?? equally great.
Any reason you can't read the FAQ?
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== 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: 08 Oct 1999 13:24:28 -0500
From: Art Haas <arthur.haas@westgeo.com>
Subject: Re: formatting numbers
Message-Id: <lrln9demn7.fsf@yoda.wg.waii.com>
inna raykhman <inna@raykhman.com> writes:
>
> does anybody know of any module or perl function that would allow me to
> format a string containing a number, you know insert comma's in all the
> right places and things.
>
I know of such a function, and you can too if you read perlfaq5 - look
for 'How can I output my numbers with commas added?'
--
###############################
# Art Haas
# (713) 689-2417
###############################
------------------------------
Date: Fri, 8 Oct 1999 11:42:28 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: formatting numbers
Message-Id: <7tldun$v2b$1@brokaw.wa.com>
inna raykhman wrote in message <37FE5DA2.5E403DD9@raykhman.com>...
>does anybody know of any module or perl function that would allow me to
>format a string containing a number, you know insert comma's in all the
>right places and things.
>or, if someone, knows the reg.exp. off the top of their head (i hope
>that's the correct phrase, it does sound weird.) anyway, that would be
>equally great.
perlfaq5: "How can I output my numbers with commas added?"
It's not off the top of my head, but I was able to look it up with the
'perldoc' command. You can look stuff up yourself using this command!
To get more information, at your favorite command line type:
perldoc perldoc
Lauren
------------------------------
Date: Fri, 08 Oct 1999 13:44:52 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: formatting numbers
Message-Id: <37FE3BA4.803A487A@texas.net>
inna raykhman wrote:
>
> Hi,
>
> does anybody know of any module or perl function that would allow me to
> format a string containing a number, you know insert comma's in all the
> right places
perlfaq5: How can I output my numbers with commas added?
> and things.
Well, that would depend upon your definition of 'things'.
- Tom
------------------------------
Date: Fri, 08 Oct 1999 18:33:20 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: formatting numbers
Message-Id: <37fe3846.265677734@news.ford.com>
[poster cc'd in e-mail]
On Fri, 08 Oct 1999 14:09:54 -0700, inna raykhman <inna@raykhman.com>
wrote:
>does anybody know of any module or perl function that would allow me to
>format a string containing a number, you know insert comma's in all the
>right places and things.
>or, if someone, knows the reg.exp. off the top of their head (i hope
>that's the correct phrase, it does sound weird.) anyway, that would be
>equally great.
=head1 Found in
/ford/thishost/unix/cen/perl5.005-02/lib/5.00502/pod/perlfaq5.pod
=head2 How can I output my numbers with commas added?
The FAQ's are all on your system, or at www.perl.com if you can't find
them.
You may also need "printf", depending on how much formatting you're
needed.
--
Clinton A. Pierce "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org Miracles." -- Miracle Max, The Princess Bride
http://www.geeksalad.org
------------------------------
Date: Fri, 08 Oct 1999 12:16:00 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Looking for Perl script to parse Ada code
Message-Id: <37FE42F0.1EA6BB51@mail.cor.epa.gov>
Uri Guttman wrote:
>
> >>>>> "S" == Streesh <streesh@caci.com> writes:
>
> S> Does anyone know where I might find this?
>
> only ada can parse ada.
heh.
But is that true? I thought Ada had a rather restrictive
grammar, which might lend itself to parsing via
Parse::RecDescent or something. But I don't know enough
about it to say for sure. You probably do.
Just because my address ends in 'gov' doesn't mean I've
ever had to program in Ada...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 8 Oct 1999 18:32:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Memory leak in assignment
Message-Id: <7tldc4$9cd$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Dan Sugalski
<dan@tuatha.sidhe.org>],
who wrote in article <P3mL3.13$IZ5.616@news.rdc1.ct.home.com>:
> > xiv is a cheating: no storage for xiv_pv and xiv_cur (sp?) is actually
> > allocated. Similarly for xnv.
>
> Now I'm confused. A base sv struct is 12 bytes (assuming 32-bit integers
> and 32-bit pointers). An xvpviv struct is 16 bytes making the same
> assumptions. An SV holding just an integer has both, for a total of 28 bytes.
If you consider xpviv, you are correct. There is no cheating about
this. But xiv and xnv take only 4 and 8 bytes respectivly.
>
> Are you saying that somewhere in the source perl cheats and encodes an
> integer with just the base sv structure? I can see how this could be done,
> by treating the sv_any pointer as an integer, but I can't see *where*
> this is done. And I just went prowling through sv.c and most of the
> pp*.c code.
No. Instead of allocating sizeof(xiv) bytes for xiv, Perl "allocates"
(here is an additional cheating, but it is irrelevant for the
discussion) 4, then moves the pointer 8 bytes backward.
Ilya
------------------------------
Date: Fri, 8 Oct 1999 14:43:09 -0600
From: "Cory W. Aitchison" <caitchison@novell.com>
Subject: Modifying file timestamps
Message-Id: <37fe5798.0@news.provo.novell.com>
Is there a way to modify a file's timestamp?
------------------------------
Date: Fri, 8 Oct 1999 14:46:14 -0600
From: "Cory W. Aitchison" <caitchison@novell.com>
Subject: Re: Modifying file timestamps
Message-Id: <37fe5850.0@news.provo.novell.com>
Sorry, nevermind, I RTMed again and found the answer only 8 pages further
on.
Apologies
Cory
Cory W. Aitchison <caitchison@novell.com> wrote in message
news:37fe5798.0@news.provo.novell.com...
> Is there a way to modify a file's timestamp?
>
>
------------------------------
Date: Fri, 8 Oct 1999 20:02:59 -0600
From: "Mike Blamires" <Mike@blamires.karoo.co.uk>
Subject: newbie possibly barking up the wrong tree...
Message-Id: <7tlf6m$gm3$1@newsreader1.core.theplanet.net>
I may be possibly on the wrong track and not have a clue here but....
Can I set my web space provided by my ISP up to run perl scripts?
http://www.karoo.net they run apache I think ) I have found nothing to say
you can nothing to say you can't, and the documentation that has come with
ActivePerl has pretty much confused me. If so how can I go about it?
Any Info Appreciated
TIA
Mike
p.s sorry if this is off-topic for the ng I figured that it was the most
appropriate.
------------------------------
Date: Fri, 08 Oct 1999 13:52:12 -0500
From: Jerry Preston <g-preston1@ti.com>
Subject: Re: NEWBIE QUESTION ON ORACLE
Message-Id: <37FE3D5C.75638DF9@ti.com>
Now I get error:
Software error:
syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 17, near ")
values"
Thanks,
Jerry
Makarand Kulkarni wrote:
> { Jerry Preston wrote:
>
> > I am new at this. I am using Perl/CGI to access Oracle. In following code:
> > insert into twroot.scrap_status( C_REMOVED_BY, C_REMOVED_NAME,
> > C_REMOVED_REASON, c_removed_date )
> > values( $Emp_Number, $Emp_Name, $Reason, $c_date );
> > gives the following error:
> > Software error:
> > syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 18, near
> > ") values" syntax error at
> > /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 33, near ") values"
> >
> > What am I doing wrong?
>
> take off the semicolon at the end of the sql statement.
> --
------------------------------
Date: 08 Oct 1999 13:18:29 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: NEWBIE QUESTION ON ORACLE
Message-Id: <xkfr9j58xve.fsf@valdemar.col.hp.com>
Jerry Preston <g-preston1@ti.com> writes:
> insert into twroot.scrap_status( C_REMOVED_BY, C_REMOVED_NAME,
> C_REMOVED_REASON, c_removed_date )
> values( $Emp_Number, $Emp_Name, $Reason, $c_date );
That looks like SQL. Can you show us some Perl code?
> syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 18, near
> ") values" syntax error at
> /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 33, near ") values"
>
> What am I doing wrong?
My PSI::ESP module is currently broken. I have a guess as to what's
going on, but I'd like to see some code before I say for sure one way or
the other.
-=Eric
--
"Cutting the space budget really restores my faith in humanity. It
eliminates dreams, goals, and ideals and lets us get straight to the
business of hate, debauchery, and self-annihilation."
-- Johnny Hart
------------------------------
Date: 08 Oct 1999 15:27:32 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: NEWBIE QUESTION ON ORACLE
Message-Id: <xkfg0zl8rwb.fsf@valdemar.col.hp.com>
Kent Perrier <kperrier@blkbox.com> writes:
> Looks like you are attempting to execute sql code inside your perl. Perhaps
> you shoud ask this question in a group where cgi related questions are asked
> and answered everyday. I know that there is one under comp.infosystems
> somewhere.
This may sound shocking, coming from me, but clpm is *exactly* the place
to be asking this question-- the problem doesn't seem to have much (if
anything) to do with CGI, but rather with interfacing with Oracle. Which
sort of thing clpm is exactly appropriate for.
-=Eric, obsfucating sentences for fun 'n' prophet
--
"Cutting the space budget really restores my faith in humanity. It
eliminates dreams, goals, and ideals and lets us get straight to the
business of hate, debauchery, and self-annihilation."
-- Johnny Hart
------------------------------
Date: Fri, 08 Oct 1999 15:29:57 -0500
From: Jerry Preston <g-preston1@ti.com>
Subject: Re: NEWBIE QUESTION ON ORACLE
Message-Id: <37FE5444.2044402@ti.com>
The insert is the only code in the sub debug called. I have no problem reading
the oracle data base. What else do you need?
Thanks,
Jerry
Eric The Read wrote:
> Jerry Preston <g-preston1@ti.com> writes:
> > insert into twroot.scrap_status( C_REMOVED_BY, C_REMOVED_NAME,
> > C_REMOVED_REASON, c_removed_date )
> > values( $Emp_Number, $Emp_Name, $Reason, $c_date );
>
> That looks like SQL. Can you show us some Perl code?
>
> > syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 18, near
> > ") values" syntax error at
> > /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 33, near ") values"
> >
> > What am I doing wrong?
>
> My PSI::ESP module is currently broken. I have a guess as to what's
> going on, but I'd like to see some code before I say for sure one way or
> the other.
>
> -=Eric
> --
> "Cutting the space budget really restores my faith in humanity. It
> eliminates dreams, goals, and ideals and lets us get straight to the
> business of hate, debauchery, and self-annihilation."
> -- Johnny Hart
------------------------------
Date: Fri, 08 Oct 1999 13:35:38 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: NEWBIE QUESTION ON ORACLE
Message-Id: <37FE559A.48F86C4B@cisco.com>
{ Jerry Preston wrote:
> Now I get error:
> syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 17, near ")
> values"
We will have to look into the context this error is being generated. Let us see some
Perl code that wraps this sql.
--
------------------------------
Date: 08 Oct 1999 15:47:19 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: NEWBIE QUESTION ON ORACLE
Message-Id: <C9F8EE09271163FE.30CF8D5579FCAD9B.1159F259318AA6A8@lp.airnews.net>
Jerry Preston <g-preston1@ti.com> writes:
> I am new at this. I am using Perl/CGI to access Oracle. In following code:
>
> insert into twroot.scrap_status( C_REMOVED_BY, C_REMOVED_NAME,
> C_REMOVED_REASON, c_removed_date )
> values( $Emp_Number, $Emp_Name, $Reason, $c_date );
>
> gives the following error:
>
> Software error:
>
> syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 18, near
> ") values" syntax error at
> /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 33, near ") values"
>
> What am I doing wrong?
Looks like you are attempting to execute sql code inside your perl. Perhaps
you shoud ask this question in a group where cgi related questions are asked
and answered everyday. I know that there is one under comp.infosystems
somewhere.
Kent
--
Groovy! Smashing! Yay capitalism!
- Austin Powers, Man of Mystery
------------------------------
Date: 08 Oct 1999 16:55:14 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: parenthesizing arguments to grep - BLOCK form
Message-Id: <x7aepto9n1.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> Uh, oh. I don't know what's going on here.
LR> Help! I need somebody's help!
i always suspected that. with this breakthrough we can start to work on
your deeper problems. now sit back and relax and repeat, "python is the
one true language"
LR> print grep {$_ % 2} 0 .. 9; # 13579
normal grep BLOCK syntax
LR> print grep ({$_ % 2} 0 .. 9); # 13579
odd grep BLOCK syntax. maybe the parens are just grouping and removed
before passing the contents to the grep op. or they are detected as a
no-op and removed during the parse.
LR> #print grep({$_ % 2} 0 .. 9); # Syntax error here!
looks like a function syntax, so there is a missing , after the anon
hash (what we think is the BLOCK). this is expected.
so only the second one is odd as it is not a legal list in parens and it
is not a function syntax. somehow that is converted into the first
version in the parser.
in any case, why did the original poster want the block form in parens?
what good could it do? grep is a list operator so it can't need any
major precedence hacking AFAIK. you could paren its list values without
using parens around the grep and block.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 08 Oct 1999 21:06:54 GMT
From: jrw32982@my-deja.com
Subject: Re: parenthesizing arguments to grep - BLOCK form
Message-Id: <7tlmd4$6fj$1@nnrp1.deja.com>
I never thought of putting a space before the opening parenthesis. Must
be some deep heuristic magic going on here.
In article <MPG.1267d365bf5d93a598a061@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:
> In article <7tksai$ivj$1@nnrp1.deja.com> on Fri, 08 Oct 1999 13:41:40
> GMT, jrw32982@my-deja.com <jrw32982@my-deja.com> says...
> > How can I parenthesize the arguments to grep when I'm using the
BLOCK
> > form?
> >
> > grep BLOCK LIST works fine
> > grep(BLOCK LIST) gives a syntax error
> >
> > The manual seems to indicate that the arguments to all functions can
be
> > parenthesized. I believe that the perl parser is interpreting the
BLOCK
> > as an anonymous hash. How can I force it to recognize a BLOCK?
>
> Uh, oh. I don't know what's going on here.
>
> Help! I need somebody's help!
>
> #!/usr/local/bin/perl -w
> use strict;
>
> print grep {$_ % 2} 0 .. 9; # 13579
>
> print grep ({$_ % 2} 0 .. 9); # 13579
>
> #print grep({$_ % 2} 0 .. 9); # Syntax error here!
> __END__
>
> This is perl, version 5.005_03 built for MSWin32-x86-object
> (with 1 registered patch, see perl -V for more detail)
>
> Copyright 1987-1999, Larry Wall
>
> Binary build 519 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
> Built 09:50:30 Aug 12 1999
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
>
--
John Wiersba
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 08 Oct 1999 12:13:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Question about alarm and run away processes
Message-Id: <37FE425F.10E328E1@mail.cor.epa.gov>
Ilya wrote:
>
> In comp.lang.perl.misc M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
> > Start with the FAQ entry, which I found in seconds with
> > 'perldoc -q timeout':
>
> > perlfaq8: How do I timeout a slow event?
>
> > and then the references therein.
>
> Thanks, but you are making a bad assumption that I haven't already looked at
> the entry. I even got the Sys::AlarmCall module. I did not find it clear
> enough, that's why I asked here.
But Ilya, you didn't *tell* anyone you'd looked in the FAQ.
You just asked a FAQ in a way which made it appear that you
had *not* seen the answer. If you had told us more, we could
have been more constructive.
Have you looked at the section in the perlipc pages on
'Signals' yet? Did that clarify things? Perhaps you could
show us some code that doesn't quite do what you wanted,
and tell us what you hoped to get.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 08 Oct 1999 12:20:33 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Sending mail with Perl?
Message-Id: <37FE4401.3CAAFAB7@mail.cor.epa.gov>
Unigni wrote:
>
> What's the easiest way to make a Perl program (for Windows, using
> ActivePerl) that can send an e-mail? I know how to send e-mails using
> telnet, so is there a way to run an automatic telnet session with Perl,
> or should I use a specific e-mail-sending command?
Well, if you check the FAQ you'll find some good hints.. some
of which are unix-centric and some of which are not. Type this:
perldoc -q "send mail"
sendmail is usually not available on win32 systems, but other
than that the suggestions are good. You could also check out
the Mail::Sender module, which is not mentioned in the FAQ.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 8 Oct 1999 20:48:29 +0200
From: "Robbertc" <robbertc@ping.be>
Subject: sendmail problem
Message-Id: <7tle3d$2bt$1@news3.Belgium.EU.net>
Hello,
i have a problem with sendmail. I've written this piece of code and it works
on my linux machine (with apache running on it).
Whenever i upload the script to my ISP and run it, nothing happens. I'm sure
the path is correct and i can use sendmail... so i guess there must me some
kind of error i'm overlooking...
What did i do wrong ? Can someone help me ?
open (SENDMAIL, "|/usr/lib/sendmail -oi -t") or die "Error: $!\n";
print SENDMAIL << "EOF";
From: robbertc\@ping.be
To: robbertc\@ping.be
Subject: Cards
Hi,
blablabla
Robbertc
EOF
close(SENDMAIL) or warn "Sendmail werd niet goed afgesloten";
thanks
robbertc
------------------------------
Date: 8 Oct 1999 18:44:10 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Shell and Perl have different $?
Message-Id: <7tle1q$9g0$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Sam Carmalt
<scarmalt@swconsult.ch>],
who wrote in article <37fe1815.183298863@news.iprolink.ch>:
> >rcp file.x user@machine:/path/somedir/copy.x
> >echo $?
> $ia = system("rcp $file_to_copy user\@machine:/path/$file_remote");
> print "\$? = $? \$ia = $ia \n";
I think this is more or less equivalent to
(rcp file.x user@machine:/path/somedir/copy.x)
Use multiarg-system() instead.
Ilya
------------------------------
Date: Fri, 08 Oct 1999 20:08:48 GMT
From: j_v_schmitt@my-deja.com
Subject: Re: Upload problem w/ Apache/Linux/CGI.pm
Message-Id: <7tlj05$3rm$1@nnrp1.deja.com>
Jonathon,
Those things are nice to know, thanks, but that wasn't it.
I ended up finding & fixing the issue after much debugging.
It turned out that CGI.pm had the bug.
Here's how I fixed it:
CGI.pm version 1.19 1999/08/31
Apache 1.3.6, Linux 2.2.5-15 (Redhat 6.0 distrib). Perl 5.005
**********
Here's the bug:
I'm testing using a html & perl script pair of files that are commonly
used
for file-upload. They are publicly available on:
http://www.terminalp.com/scripts/file_upload.shtml
When a file is specified, it will succeed by uploading the file and
displaying
the results page.
However, if the filename is left blank, there is a server error,
and the apache log file indicates "premature end of script headers."
*********
Here's the fix:
in line 2862 of CGI.pm, change
unless (defined $filename) {
to
unless (defined $filename & $filename gt "") {
This works. Files are still uploaded, and it doesn't abort when a
filename isn't specified.
I only suspect that the problem was that the Netscape browser and/or
Apache was sending a filename that "existed", but was essentially NULL.
-John
In article <37f48145_1@newsread3.dircon.co.uk>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> j_v_schmitt@my-deja.com wrote:
> > My simple form handler dies ("Premature end of script headers" shows
> > up in the log file) when I DON'T specify a file to upload.
> >
> > If I do specify a file to upload, then the form handler passes by
fine,
> > and will display "Hello there".
> >
> > I'm running Apache 1.3.6 on Redhat Linux 6.0, and have installed
CGI.pm
> > This worked fine on my Unix/Netscape server, but fails on the
> > Linux/apache.
> >
> > Here's the bare-bones handler file:
> >
> > #!/usr/bin/perl
> >
> > # creates new CGI object using the CGI.pm library
> > use CGI qw(:standard);
> > $query = new CGI;
>
> You dont need to import the symbols (qw(:standard)) *and* instantiate
a
> CGI object - you have to decide whether you want to use the procedural
> or the OO interface to CGI.pm - generally if you only have a simple
> program then the procedural interface will be fine ...
>
> I dont think thats the cause of your problem though.
>
> BTW you shouldnt need to install CGI.pm on a recent Perl as it is part
> of the distribution.
>
> /J\
> --
> "Do you want to go to court today?" - BBC News Website
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 08 Oct 1999 20:06:51 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: What is THE book for PERL?
Message-Id: <7tlisg$3qp$1@nnrp1.deja.com>
In article <WAkL3.1578$nU4.7106@news1.online.no>,
"Trond Michelsen" <mike@crusaders.no> wrote:
>
> Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk> wrote in message
> news:37FD9728.257BC43@dcs.qmw.ac.uk...
> > Can anyone in the know tell me the _best_ book to read/buy for
> research
> > and reference into PERL?
>
> If you only want to buy _ONE_ book about Perl, you should buy "The
Perl
> CD Bookshelf"
I highly agree. I learned Perl by reading the "man page" under Perl4,
and the zillions of POD files that got exploded to under Perl5. That's
really the only reference you need, everything is there.
However, it's VERY nice to have a cookbook; it may save you a lot of
time, and if it's a good cookbook (which this one is), you learn a lot
by seeing how the experts do even the simple things.
So, get the cookbook in printed or CD form. If reading online
documentation aggravates you, also get "Programming Perl", which is the
printed equivalent of the online docs.
If you have a Windoze machine, install ActivePerl (even if you are
lucky enough to be programming in Unix), because it will create a very
nicely organized HTML documentation set for you.
If you get stuck, post to this newsgroup. Once you get past the most
obvious problems, post to comp.lang.perl.moderated.
good luck,
glauber
--
Glauber Ribeiro
theglauber@my-deja.com
"Opinions stated are my own and not representative of Experian"
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 1024
**************************************