[9433] in Perl-Users-Digest
Perl-Users Digest, Issue: 3028 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 30 14:18:26 1998
Date: Tue, 30 Jun 98 11:02:15 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 30 Jun 1998 Volume: 8 Number: 3028
Today's topics:
Re: WIN32::ODBC and use of <rthorne@netscape.com>
Re: Windows95, Perl-32 and Personal Web Server (PWS) brian@omegadm.co.uk
writing to a file <amir@fnd.com>
Re: writing to a file (Bob Trieger)
Re: writing to a file <none@spam.com>
Re: writing to a file (Bob Trieger)
Re: writing to a file <none@spam.com>
Re: writing to a file <none@spam.com>
Re: writing to a file <blockmar@nxs.se>
Re: writing to a file <rootbeer@teleport.com>
Re: writing to a file <rootbeer@teleport.com>
Re: writing to a file (Bob Trieger)
Re: writing to a file (Bob Trieger)
Re: writing to a file <none@spam.com>
Re: Writing to COM ports with perl under Win95 (Bbirthisel)
X.500 Client <Marcus.Priesch@nl.cis.philips.com>
xargs, stdin, and shell redirection (John C White)
yacc (and lex) in Perl <hutchinson@aigfpc.com>
Re: yacc (and lex) in Perl <jwb79@mail.idt.net>
Re: yacc (and lex) in Perl <jll@skynet.be>
Re: yacc (and lex) in Perl <david.x.corcoran@boeing.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 29 Jun 1998 19:17:53 -0700
From: "R. Toren" <rthorne@netscape.com>
Subject: Re: WIN32::ODBC and use of
Message-Id: <35984AD0.584964B3@netscape.com>
hstack may also want to look at the Spring 1998 edition of the Perl
Journal, which has a pretty good article on Win32::ODBC. The article
has some useful sample code, and a few pointer to where you can find
more.
Michael Sazonov wrote:
> hstack@att.com wrote in message
> <6mrlk3$rdn@newsb.netnews.att.com> ...
> >I need some help seeing how many rows were affected in an
> update query. How
> >do I do it, rowcount does not work.
> >
> >use Win32::ODBC;
> >
> >$sql = "update table1 set field = 'newvalue' where field
> like 'oldvalue';
> >$ret = $s_table->Sql($sql);
> >
>
> Use select statement with the same criteria before update:
>
> $sql = "select count(*) as cnt from table1 where field like
> 'oldvalue'";
> $ret = $s_table->Sql($sql);
> $s_table->FetchRow;
> $cnt = $s_table->Data;
>
> I hope this will help.
>
> ===
> Mike, sysadmin
>
--
-----------
Rob Thorne
Int'l software tools & hacks, etc.
Netscape Communication Corp.
------------------------------
Date: Mon, 29 Jun 1998 17:14:48 GMT
From: brian@omegadm.co.uk
Subject: Re: Windows95, Perl-32 and Personal Web Server (PWS)
Message-Id: <6n8i29$h0p$1@nnrp1.dejanews.com>
In article <6m697l$d3j@www001.itanet.com.br>,
"BBQ" <warp@internetcom.com.br> wrote:
>
> I had a similar setup at home, and discovered that PWS simply doesn't do
> what it's supposed to with PERL (or anything else for that matter). I
> haven't run into the system() problem, but I had many others, like not
> managing to print headers diferent than Content-type: html/text\n\n, or
> maintaining a persistant connection.
>
> Try running WebSite Lite from O'Reiley! Solved my problem, and its freeware
> for non-comercial use...
>
Hi BBQ
I too have been trying to get MS PWS / Frontpage97 to work with perl to no
avail. Following your advice I have installed WebSite1.1e and FP extns. My
Perl scripts worked first time, but I am having problems using the IDC
(Internet Database Connector). This is OK with PS PWS.
Do you happen to know if the IDC will work on WebSite with FP extns??
Thanks in advance, Brian
BTW: what did you substitue for '/usr/lib/sendmail' on your win95 machine??
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 29 Jun 1998 07:29:39 -0700
From: amir <amir@fnd.com>
Subject: writing to a file
Message-Id: <3597A4D3.BDA501F5@fnd.com>
Hi all,
I am trying to write certain ENV{HTTP_XYZ} to an external file, with not
much success in PERL (I am new to Perl). When somone clicks on my home
page, I want to keep a log of the HTTP_REFERER in an External file
------------------------------
Date: Sun, 28 Jun 1998 23:28:33 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: writing to a file
Message-Id: <6n6jmp$75h$1@strato.ultra.net>
[ posted and mailed ]
amir <amir@fnd.com> wrote:
-> I am trying to write certain ENV{HTTP_XYZ} to an external file, with not
-> much success in PERL (I am new to Perl).
Spend $30 bucks on a book (`Learning Perl') and start learning. Then go to
http://www.perl.com/ and read everything there, up to and including the FAQs.
Then download and install the perl interpreter for your operating system.
-> When somone clicks on my home
-> page, I want to keep a log of the HTTP_REFERER in an External file
This is cgi. After doing all of the above, check out
news:comp.infosystems.www.authoring.cgi , read the FAQ there, lurk for a
couple of weeks and if your questions aren't answered, post them with a clear
subject line.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Sun, 28 Jun 1998 16:35:45 -1000
From: "Locke" <none@spam.com>
Subject: Re: writing to a file
Message-Id: <3596d3c9.0@news.hawaii.rr.com>
open FAP, ">>log";
print FAP $ENV{'HTTP_REFERER'};
close FAP;
amir wrote in message <3597A4D3.BDA501F5@fnd.com>...
>Hi all,
>I am trying to write certain ENV{HTTP_XYZ} to an external file, with not
>much success in PERL (I am new to Perl). When somone clicks on my home
>page, I want to keep a log of the HTTP_REFERER in an External file
>
------------------------------
Date: Mon, 29 Jun 1998 02:44:03 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: writing to a file
Message-Id: <6n6v5a$k9q$2@ligarius.ultra.net>
"Locke" <none@spam.com> wrote:
-> open FAP, ">>log";
-> print FAP $ENV{'HTTP_REFERER'};
-> close FAP;
What if the open fails?
What if $ENV{HTTP_REFERER} is empty?
Why the quotes around HTTP_REFERER?
What will happen to `log' if 2 people hit the site at same time?
What if the close fails?
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Sun, 28 Jun 1998 20:22:47 -1000
From: "Locke" <none@spam.com>
Subject: Re: writing to a file
Message-Id: <35970902.0@news.hawaii.rr.com>
I was giving him a starting point, not code he should just insert....
If he needs security he can add it as he see's fit.
I don't see you answering your own questions so you're not helping him more
than I just did.
Bob Trieger wrote in message <6n6v5a$k9q$2@ligarius.ultra.net>...
>"Locke" <none@spam.com> wrote:
>-> open FAP, ">>log";
>-> print FAP $ENV{'HTTP_REFERER'};
>-> close FAP;
>
>What if the open fails?
>What if $ENV{HTTP_REFERER} is empty?
>Why the quotes around HTTP_REFERER?
>What will happen to `log' if 2 people hit the site at same time?
>What if the close fails?
>
>Bob Trieger
>sowmaster@juicepigs.com
>" Cost a spammer some cash: Call 1-800-286-0591
> and let the jerk that answers know that his
> toll free number was sent as spam. "
------------------------------
Date: Sun, 28 Jun 1998 20:26:36 -1000
From: "Locke" <none@spam.com>
Subject: Re: writing to a file
Message-Id: <359709e8.0@news.hawaii.rr.com>
more in depth...
Bob Trieger wrote in message <6n6v5a$k9q$2@ligarius.ultra.net>...
>"Locke" <none@spam.com> wrote:
>-> open FAP, ">>log";
>-> print FAP $ENV{'HTTP_REFERER'};
>-> close FAP;
>
>What if the open fails?
open FAP, ">>log" || die "can't open file";
>What if $ENV{HTTP_REFERER} is empty?
Then you still recorded the referer. Would you want a background tracker to
spit out an error message?
>Why the quotes around HTTP_REFERER?
Still works
>What will happen to `log' if 2 people hit the site at same time?
man flock
>What if the close fails?
who cares? end of script.. if opened again it will close it.
>
>Bob Trieger
>sowmaster@juicepigs.com
>" Cost a spammer some cash: Call 1-800-286-0591
> and let the jerk that answers know that his
> toll free number was sent as spam. "
------------------------------
Date: Mon, 29 Jun 1998 08:47:50 +0200
From: - <blockmar@nxs.se>
Subject: Re: writing to a file
Message-Id: <35973896.A905C97@nxs.se>
try using
if ( open ( MY_HANDEL, "> /tmp/myfile.txt"))
{
print MY_HANDEL, "INFO\n";
}
else
{
print "Can't open file\n";
}
one > = write (new file )
two >> = append to file
(I hope i didn't do any misstakes in my example :-))
/blockmar
amir wrote:
>
> Hi all,
> I am trying to write certain ENV{HTTP_XYZ} to an external file, with not
> much success in PERL (I am new to Perl). When somone clicks on my home
> page, I want to keep a log of the HTTP_REFERER in an External file
------------------------------
Date: Mon, 29 Jun 1998 07:12:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: writing to a file
Message-Id: <Pine.GSO.3.96.980629001033.21917N-100000@user2.teleport.com>
On Sun, 28 Jun 1998, Locke wrote:
> open FAP, ">>log" || die "can't open file";
That's not the right way to do this; if the open fails, you'll never know
it. Check the precedence chart. Also, it's generally good to include $! in
the error message. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 29 Jun 1998 07:14:16 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: writing to a file
Message-Id: <Pine.GSO.3.96.980629001234.21917O-100000@user2.teleport.com>
On Mon, 29 Jun 1998, - wrote:
> print MY_HANDEL, "INFO\n";
Close, very close. But if you try using this, perl will tell you what's
wrong with it, so I won't. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 29 Jun 1998 11:43:53 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: writing to a file
Message-Id: <6n7uph$9u9$3@ligarius.ultra.net>
"Locke" <none@spam.com> wrote:
-> I was giving him a starting point, not code he should just insert....
->
-> If he needs security he can add it as he see's fit.
->
-> I don't see you answering your own questions so you're not helping him more
-> than I just did.
I told him to buy and read `Learning Perl' as well as the FAQs for perl and
cgi. Opening a file for writing is one of the basic operations of perl and
sooner or later he is going to have to pick up a book and read it. Do you
intend to explain every function to him as he comes asking them one or two at
a time?
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Mon, 29 Jun 1998 11:52:50 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: writing to a file
Message-Id: <6n7vaa$dp8$1@ligarius.ultra.net>
"Locke" <none@spam.com> wrote:
-> more in depth...
->
-> Bob Trieger wrote in message <6n6v5a$k9q$2@ligarius.ultra.net>...
-> >"Locke" <none@spam.com> wrote:
-> >-> open FAP, ">>log";
-> >-> print FAP $ENV{'HTTP_REFERER'};
-> >-> close FAP;
-> >
-> >What if the open fails?
->
-> open FAP, ">>log" || die "can't open file";
Because of precedences, it is better to use `or' instead of `||'.
-> >What if $ENV{HTTP_REFERER} is empty?
->
-> Then you still recorded the referer. Would you want a background tracker to
-> spit out an error message?
If there were no referer, how was one recorded? I wouldn't want an error
message, that is why I would test for it before trying to do anyoperations
with it. If it wasn't defined, I would simply end the script or print `no
referer' to my log.
-> >Why the quotes around HTTP_REFERER?
->
-> Still works
true.
-> >What will happen to `log' if 2 people hit the site at same time?
->
-> man flock
there is no `man' on Win32 and Mac systems.
-> >What if the close fails?
->
-> who cares? end of script.. if opened again it will close it.
Try it and you will find that you are wrong. If the file isn't closed
correctly, you can't use it again in your script.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Mon, 29 Jun 1998 18:08:12 -1000
From: "Locke" <none@spam.com>
Subject: Re: writing to a file
Message-Id: <35983a54.0@news.hawaii.rr.com>
no comma
- wrote in message <35973896.A905C97@nxs.se>...
>try using
>
>if ( open ( MY_HANDEL, "> /tmp/myfile.txt"))
>{
>print MY_HANDEL, "INFO\n";
>}
>else
>{
>print "Can't open file\n";
>}
>
>one > = write (new file )
>two >> = append to file
>
>(I hope i didn't do any misstakes in my example :-))
>
>/blockmar
>
>amir wrote:
>>
>> Hi all,
>> I am trying to write certain ENV{HTTP_XYZ} to an external file, with not
>> much success in PERL (I am new to Perl). When somone clicks on my home
>> page, I want to keep a log of the HTTP_REFERER in an External file
------------------------------
Date: 29 Jun 1998 20:28:17 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Writing to COM ports with perl under Win95
Message-Id: <1998062920281700.QAA05229@ladder01.news.aol.com>
Hi Jon:
>Quick question: How do you direct output to a com port under perl >on a
win95/DOS platform.
If all you need is to output without modifying any port parameters,
you can open a filehandle.
For any other port access, use Win32API::SerialPort. Alpha 4 is
available at :
http://members.aol.com/Bbirthisel/alpha.html
This works with NT and Win95, but not DOS. I have not yet
received any Win98 reports. The differences between alpha 4
and beta are mostly documentation improvements. The beta will
go to CPAN.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Mon, 29 Jun 1998 16:19:31 +0200
From: Marcus Priesch <Marcus.Priesch@nl.cis.philips.com>
Subject: X.500 Client
Message-Id: <3597A273.4DDF8F09@nl.cis.philips.com>
Hi Folks !
I have to write a X.500 Client Application. Has anyone such thing
done already - is there some code out there ? - i guess it is !
thanks for any comments.
marcus.
--
----------------------------------------------
Marcus Priesch - Philips CE - Predevelopment
email: Marcus.Priesch@nl.cis.philips.com
----------------------------------------------
------------------------------
Date: 30 Jun 1998 01:33:30 -0700
From: johnjohn-clpm1@triceratops.com (John C White)
Subject: xargs, stdin, and shell redirection
Message-Id: <x71zs7e1b9.fsf@1>
I use a utility which I traditionally call with text at stdin,
and a listing of command line args.
eg.
<file ./util stdarg1 [arglist]
where arglist is a potentially long list of arguments, space delimited.
I'm concerned about overflowing the command line, so I'd like to incorporate
an xargs call. But ... now I have two items competing for stdin.
I can easily get arglist in a \n delimited form for:
<[arglist] xargs -i /usr/bin/bash -c '<file ./util stdarg1 {}'
Now, when I generate arglist from within perl, and call the above as
a pipe:
open (UTIL, "| xargs -i /usr/bin/bash -c '<file ./util stdarg1 {}' ") or die
"error opening pipe to util!\n"
print UTIL "$arglist";
close UTIL;
Doesn't work. the error is all I get, even in debug mode.
Any ideas?
John
--
John White
Triceratops Admin
johnjohn@triceratops.com
------------------------------
Date: Mon, 29 Jun 1998 15:17:58 -0700
From: Stuart Hutchinson <hutchinson@aigfpc.com>
Subject: yacc (and lex) in Perl
Message-Id: <35981296.1303@aigfpc.com>
G'Day,
Just wondering if anyone knows of a yacc equilalent in Perl.
Ie a yacc that produces Perl programs.
Thanks in advance,
Cheers,
Phil
------------------------------
Date: 29 Jun 1998 07:36:23 GMT
From: "jim babbington" <jwb79@mail.idt.net>
Subject: Re: yacc (and lex) in Perl
Message-Id: <01bda32f$bf467ca0$6488fdc7@dixon>
> G'Day,
> Just wondering if anyone knows of a yacc equilalent in Perl.
> Ie a yacc that produces Perl programs.
> Thanks in advance,
> Cheers,
> Phil
I'm a big fan of lexical analysis, and I use Lex/YACC from time to time,
however,
I don't know of any one-to-one functional equivilents.
Using perl like a pocket srewdriver, I have been able to get parsing
functionality
using regular expressions. Token/name handling can be done, but your going
to
have to do the doing. Also, regexp's don't read well (not that Lex does
either),
but you can accomplish a lot in a few lines. There are SQL parsers in perl
(Sprite.pm
comes to mind), you may want to download one and retro-engineer the core
for whatever your trying to accomplish.
Good Luck!
Jim
Nervous breakdowns can happen without warning - whear a helmet!!!
------------------------------
Date: Mon, 29 Jun 1998 12:00:29 +0200
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: yacc (and lex) in Perl
Message-Id: <VA.000000d2.0094d712@jll>
> Just wondering if anyone knows of a yacc equilalent in Perl.
> Ie a yacc that produces Perl programs.
In addition to what's already available on CPAN
(http://www.perl.com/CPAN) there's a proposal for YAPP (Yet Another
Perl Parser) in comp.lang.perl.modules. Go there, say you're interested
and d/load the code. Lucky you <g>
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy
------------------------------
Date: Mon, 29 Jun 1998 16:55:10 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
Subject: Re: yacc (and lex) in Perl
Message-Id: <3597C6EE.17A8@boeing.com>
Stuart Hutchinson wrote:
>
> G'Day,
> Just wondering if anyone knows of a yacc equilalent in Perl.
> Ie a yacc that produces Perl programs.
> Thanks in advance,
> Cheers,
> Phil
I came across this some time back, and bookmarked it for reference:
http://www.plover.com/~mjd/perl/py
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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 V8 Issue 3028
**************************************