[7672] in Perl-Users-Digest
Perl-Users Digest, Issue: 1298 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 10 23:08:03 1997
Date: Mon, 10 Nov 97 20:00:22 -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 Mon, 10 Nov 1997 Volume: 8 Number: 1298
Today's topics:
"perl aware" vi editor? , snailgem@aol.com
Re: 500 Internal Server Error (Martien Verbruggen)
Re: Alternatives to CGI.pm (was Re: Continuations in pe <ajh@rtk.com>
Any Ideas... <itootall@earthlink.net>
Re: Any Ideas... (Martien Verbruggen)
Re: array to scalar coercion (mysplice) <bnelson@netcom.com>
Re: Better Way in Perl (Abigail)
Contract Programming Opportunity <dan@telluscom.com>
Could not load ADVAPI32.Dll <antispam@antispam.com>
exec. external shell prog (Matthias Bodenbinder)
Re: glob not working (Andrew M. Langmead)
header files for scripts run from procmail? <djacobs@tsoft.com>
Help with UDP (Eric Hollander)
Re: Help with UDP <tobias@spurv.td.org.uit.no>
How to assign values to arrays? (Waqar Hafiz)
Re: interrupt system("$cmd") if timeout <cs@zip.com.au>
Re: Newbie extraction question <tobias@spurv.td.org.uit.no>
Re: Newbie extraction question (Martien Verbruggen)
Re: newbie having trouble with install (Matthew Cravit)
Perl 5.004_02 for NT and SIGINT <mallwitz@intershop.de>
Perl 5.004_02 for NT bind() bug <mallwitz@intershop.de>
Re: Problem with read (COWBYS)
Re: SQL statement in Perl (Tad McClellan)
Re: Timezone conversion (Martien Verbruggen)
Re: Updating current HTML page with Perl CGI... HELP!! <gdoucet@ait.acl.ca>
Re: Year2000 problem with localtime(); (Fabrice Scemama)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 10 Nov 1997 22:50:03 -0500
From: , snailgem@aol.com
Subject: "perl aware" vi editor?
Message-Id: <3467D5EA.4267@aol.com>
Does anyone know what a "perl aware" vi editor is?
Thanks.
------------------------------
Date: 11 Nov 1997 00:12:37 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: 500 Internal Server Error
Message-Id: <6487tl$1n9$2@comdyn.comdyn.com.au>
In article <647upk$s9p$4@news.mandic.com.br>,
franco@hacker.com (FRANCO) writes:
hacker.com, hmm? Now where did I have my definition of hacker
again?
> I have a problem on Apache 1.2.0(Binary Dowload)Runing on LInux 1.2.13,
> On execute Scripts (CGI/Perl) , an error ocorred , is : 500 Internal
> Server Error, hum... and nao ???
This is not a perl question, but instead is a question about why your
web server is giving you some error. But since we get this question so
often, there is a FAQ entry for it:
perldoc perlfaq9
first question:
My CGI script runs from the command line but not the
browser. Can you help me fix it?
(It DOES run from the command line, doesn't it?)
> Anyone help me ??
read the FAQ.
> ..:mail me to fecap39@hotmail.com
Nope. Post here, read here, especially if the email address you submit
this question from is not even the same as you want it posted to.
First you ask a question that has nothing to do with perl, and which
could have been answered by reading the documentation, and then you
want me to do go through the trouble of typing a Cc line for you?
Don't think so.
> TanKX
sure.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd. | negative.
NSW, Australia |
------------------------------
Date: Mon, 10 Nov 1997 17:54:14 -0800
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: Alternatives to CGI.pm (was Re: Continuations in perl?)
Message-Id: <648dor$ikv$1@brokaw.wa.com>
I R A Aggie wrote in message <-0211971244150001@aggie.coaps.fsu.edu>...
>In article <878450119.324524@ridge.spiritone.com>, "Aaron Harsh"
><ajh@rtk.com> wrote:
>
>+ Binding a perl object to a Web page seems straightforward. Getting the
>+ results is straightforward. The difficult part seems to be saving state
>+ between invocations (both variables, and position inside the program).
>
>Maybe I don't understand, but doesn't CGI.pm already do some of this?
I think CGI.pm does a great job at a lot of this stuff.
But as an example of something that's just beyond the scope of CGI.pm,
consider:
- Keeping a database or statement handle between invocations
- Maintaining position in a file handle
- Preserving child processes (e.g., a pipe'd file handle)
Plus there's the problem of a program losing its current position, which
seems to be just as big an issue.
I know that mod_perl can help with some of this stuff, but only in specific
cases (I can't depend on the same httpd processing being called each time).
Anyway, it sounds like the thing to do is to have a process for each session
running on the server side, and have CGI scripts which do nothing but
communicate with the persistent processes.
Does anyone see a better way of doing this? Is it even clear what I'm
trying to do?
Aaron Harsh
ajh@rtk.com
------------------------------
Date: Mon, 10 Nov 1997 17:53:45 -0600
From: <itootall@earthlink.net>
Subject: Any Ideas...
Message-Id: <6486fs$bbb@argentina.earthlink.net>
I have a small problem, I need a rotating banner-link system that is very
uncomplicated. Any Ideas are greatly appreciated. I currently am working on
one that is a simple perl script but I am having some difficulties with it.
For some reason when I use SSI to call the script it returns with this
statement:
[an error occurred while processing this directive]
What on earth does this mean??
Thanks for any suggestions!!!
------------------------------
Date: 11 Nov 1997 01:21:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Any Ideas...
Message-Id: <648buf$22q$1@comdyn.comdyn.com.au>
In article <6486fs$bbb@argentina.earthlink.net>,
<itootall@earthlink.net> writes:
> I have a small problem, I need a rotating banner-link system that is very
> uncomplicated. Any Ideas are greatly appreciated. I currently am working on
> one that is a simple perl script but I am having some difficulties with it.
Why reinvent the wheel? Go to www.cgi-resources.com, and find loads of
banner-rotating scripts there.
> For some reason when I use SSI to call the script it returns with this
> statement:
>
> [an error occurred while processing this directive]
This is not a perl error. It is an error put there by your web server.
read the documentation that came with the web server to find out
somehting about what it means.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use being
NSW, Australia | a damn fool about it.
------------------------------
Date: Tue, 11 Nov 1997 02:25:53 GMT
From: Bob Nelson <bnelson@netcom.com>
Subject: Re: array to scalar coercion (mysplice)
Message-Id: <648fnh$72c$1@renpen.nelson.org>
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Sun, 9 Nov 1997, Bob Nelson wrote:
> > Here's a less ambitious subroutine yielding the diagnostic: ``Bizarre
> > copy of ARRAY in aassign at ...''.
> This sounds like a job for... perlbug! :-)
Thanks for the tip. I've been programming long enough to realize that
99.44% of the time, it is my fault...even when faced with the man page
showing this (P) is one error I ``...should never see.''
FWIW...here's the workaround I've done in the routine:
sub ary_and_len (\@$) {
my($aref) = $_[0];
my $elems;
# my hack to make this work, inelegant but results are ok:
if($_[1] =~ /\d+/) {
$elems = $_[1];
}
else {
$elems = \$_[1], $elems = @$elems;
}
print "array has $elems elements, as follows:\n",
foreach(@$aref) {
print "$_\n";
}
--
========================================================================
Bob Nelson -- Dallas, Texas, USA (bnelson@iname.com)
http://www.geocities.com/ResearchTriangle/6375
========================================================================
------------------------------
Date: 11 Nov 1997 02:18:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Better Way in Perl
Message-Id: <slrn66fg7q.kcu.abigail@betelgeuse.wayne.fnx.com>
Walker Curtis (curtis@ei.kodak.com) wrote on 1532 September 1993 in
<URL: news:34670FD2.4942A63@ei.kodak.com>:
++
++ Abigail wrote:
++
++ >
++ > Or ls, a pipe and -n:
++ >
++ > ls|perl -ne'/\.cin$/&&`mv $_ $\``'
++
++ Don't you need to strip the return on $_ to make this work?
So, stick in an extra -l:
ls|perl -nle'/\.cin$/&&`mv $_ $\``'
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^(11+?)\1+$/'
------------------------------
Date: Mon, 10 Nov 1997 18:37:51 -0600
From: Dan Gauthier <dan@telluscom.com>
Subject: Contract Programming Opportunity
Message-Id: <3467A8DF.167E@telluscom.com>
I am looking for a Perl programmer in the Houston, TX area to develop
Web-based applications. Most apps involve integrating with an SQL
database - currently MySQL.
Thanks,
Dan Gauthier
Tellus Technologies
------------------------------
Date: Mon, 10 Nov 1997 19:52:20 -0500
From: Yves Roy <antispam@antispam.com>
Subject: Could not load ADVAPI32.Dll
Message-Id: <3467AC44.653E@antispam.com>
Hi everybody,
I've tried looking around and just can't find any help on this problem.
I'm running IIS 3.0 on NT 4.0. The problem I am having
is that perl will stops working ever now and then and reports an error
like:
Error executing CGI script: 'Could not load Advapi32.dll'?
Stoping the WWW service and restarting does not help. I have to reboot
the
server.
I also checked the PerlErr.Log file and found a few:
INTERNAL ERROR: PerlParser did not exit clean!!
What does this meen?
Thanks for your help.
Yves
PS: Reply in this newsgroup. I'll check messages everyday in this
newsgroup.
------------------------------
Date: 11 Nov 1997 01:01:24 GMT
From: mbod@chem.ubc.ca (Matthias Bodenbinder)
Subject: exec. external shell prog
Message-Id: <648ap4$pkt$1@nntp.ucs.ubc.ca>
Hello,
I am a complete novice to perl and I have a problem executing gnuplot
from within a perl script (Linux, perl 5.003).
The perl script generates a gnuplot file 'foo'. This file can be processed
from gnuplot without error message when I invoke gnuplot from the
commandline:
$ gnuplot foo
gnuplot then generates a postscript file 'out.eps'. Unfortunately this
does not work when I invoke gnuplot from within my perl script. There are
no error messages (I use 'perl -w') and there is no 'out.eps' file. I
have tried a couple of different ways:
`gnuplot foo`;
system( "gnuplot foo" );
system( "gnuplot", "foo" );
gnuplot is executed and 'foo' is read (when I change the name gnuplot
complains about a wrong filename). But there is no way I can get the
'out.eps' file.
What is going wrong?
Thanks in advance,
Matthias
--
Dr. Matthias Bodenbinder | email: mbod@chem.ubc.ca
Department of Chemistry | phone: (+1 604) 822-2438
University of British Columbia | fax : (+1 604) 822-2847
2036 Main Mall |
Vancouver, B.C., Canada V6T 1Z1 | ** PGP key available **
------------------------------
Date: Tue, 11 Nov 1997 01:30:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: glob not working
Message-Id: <EJGK6G.DDx@world.std.com>
l41484@alfa.ist.utl.pt (Umm) writes:
>Andrew M. Langmead (aml@world.std.com) wrote:
>: If perl is trying to use the C shell, and there is none present, then
>: your perl is misconfigured. (Most likely, it was configured on a
>:-( How can re-configure it? (presuming it can be done without recompiling)
Reconfiguring is done by recompiling. If Configure is getting messed
up on thinking there is a csh, run Configure, and when it tells you it
is giving you the last opportunity to do a shell escape, edit the file
config.sh and change the variable d_csh to 'undef'
--
Andrew Langmead
------------------------------
Date: 11 Nov 97 03:52:23 GMT
From: Doug Jacobs <djacobs@tsoft.com>
Subject: header files for scripts run from procmail?
Message-Id: <3467d677.0@news.tsoft.net>
Greetings.
I'm developing a number of scripts to be run through procmail (eg. if the
recipe matches, kick off this script and feed the message into it.)
Because these scripts use many common libraries, variables, and other things,
I tried to create a file with these common things, then "require" them in each
script - a sort of header file for PERL if you will.
Here's my problem:
The "header" file works fine when the script the command line, however
when Procmail kicks it off, things go awry (it can't find the header file.) When I
copy the header file into the scripts, they run fine when either I run them from the
command prompt or through Procmail. The downside of this is when I change something
that was in the "header" file, I need to change it in all the files - a bit tedious
and error-prone as these scripts are used on a couple of different accounts. This
was also why I wanted a "header" file so badly - only 1 source to change, and
everyone's happy. I'm trying to figure out what is so different about running a
script with the "header" file from the command line vs. Procmail and am not having
much luck. I have set up my Procmail-rc file with as much information for its
environment as possible, including the path for the directory with all the scripts
in it. However, Procmail seems unable to find the header file even though it is in
one of the directories listed in its PATH variable.
Any ideas would be most welcome.
Thanks in advance.
Doug
------------------------------
Date: 10 Nov 1997 17:46:18 -0800
From: hh@scam.XCF.Berkeley.EDU (Eric Hollander)
Subject: Help with UDP
Message-Id: <648dda$sp6@scam.XCF.Berkeley.EDU>
I want to do something which should be very simple: have a program which
listens to a UDP socket, and have another which sends, so I can pass
messages back and forth. I know this can be done in perl, but the only
documentation is a cryptic example program, which I can't get to do what I
want. It calls functions (such as select and sockaddr_in) which has
incomplete or non-existant documentation. What should I do? Has anyone
gotten this to work?
Thanks,
e
------------------------------
Date: 11 Nov 1997 04:42:04 +0100
From: Tobias Brox <tobias@spurv.td.org.uit.no>
Subject: Re: Help with UDP
Message-Id: <xn6200o6qr7.fsf@spurv.td.org.uit.no>
hh@scam.XCF.Berkeley.EDU (Eric Hollander) writes:
> messages back and forth. I know this can be done in perl, but the only
> documentation is a cryptic example program, which I can't get to do what I
> want. It calls functions (such as select and sockaddr_in) which has
> incomplete or non-existant documentation. What should I do? Has anyone
> gotten this to work?
I'm perhaps not the right person to answer, but it seems like nobody
else has answered yet.
I remember I had similar problems. Back at that stage, I had no
experience with ICP. I'd daresay the IPC documentation requires a
knowledge of the ICP library for C.
So, my advice is to read the manual pages for the C functions.
The document
http://www.cs.uit.no/Lokalt/Studieinfo/Kurs/d242/Info/sockets.ps is an
easy-to-read paper concerning socket programming. Unfortunately it's
at Norwegian, but the figures at page 4 should describe the basic
functions you need to call in a C program quite well.
--
Tobias Brox - tobix@abex.no - http://www.cs.uit.no/~tobias
------------------------------
Date: Mon, 10 Nov 1997 22:48:49 +0000
From: waqar.hafiz@virgin.net (Waqar Hafiz)
Subject: How to assign values to arrays?
Message-Id: <3.0.3.32.19971110224849.006a59d8@mail.virgin.net>
The output of an application gives me the following string of data:
1. Category subcategory1 data1 data2 subcategory2 data3 data4 data5
subcategory3 ...
or it may output like this:
2. Category subcategory3 data1 data2 subcategory1 data3 data4 data5
subcategory2 ...
I know the keywords - subcategory1, subcategory2, subcategory3 ....
How can I go through the list and assign all data values for a subcategory
to an array? In the 2nd example above:
@subcategory1 would contain data3, data4 & data5
@subcategory3 would contain data1 & data2
.......
Thanks in advance
Waqar
------------------------------
Date: 11 Nov 1997 01:16:09 GMT
From: Cameron Simpson <cs@zip.com.au>
Subject: Re: interrupt system("$cmd") if timeout
Message-Id: <19971111131211-cameron-1-19942@sid.research.canon.com.au>
Jay Rogers <jay@rgrs.com> writes:
| > > | I could not find information about interrupting
| > > | a process started by system("$cmd") if a specified timeout
| > > | occured.
| > > | For example, rsh will time out in 75 seconds if the
| > > | remote machine is down. [...]
| > > Use fork() instead of system. In the child, set an alarm for 75 seconds.
| > > Then wait() in the parent, more or less as normal.
| > Thanks for your help. However, it does not seem to work.
| > The problem is that, at least tested on my linux machine,
| > sh spawns another process. So after the sh process timed
| > out, its child continues.
Well, if it's just one process, say "exec rsh ..." instead of "rsh ...".
That way the shell replaces itself instead of spawning a child.
Another option is to have the child put itself into its own process group
with setpgrp(), set the alarm() in the parent, catch SIGALRM, and kill
the child's group instead of just the process-id. See kill() for how.
A cleaner option: some systems let you set a real-time limit (which like most
things gets inherited by children). Set it instead of using an alarm() - the
whole child subtree of processes should terminate at the appointed time
without any funny mucking with process groups, alarms, or signals.
[ Let me just reach for a linux system... Ok. ]
Hmm, not on linux or solaris. Bummer.
Looks like Jay Rogers' process group suggestion is the go then.
--
Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/
This is the reason that the rates are so high, not because of the insurance
company's actuarial tables. It's hard for a bureaucrat to understand that
anytime he sets a ceiling on a price, he also sets a floor.
- Dave Tharp, DoD #0751, davet@interceptor.CDS.TEK.COM
------------------------------
Date: 11 Nov 1997 01:13:27 +0100
From: Tobias Brox <tobias@spurv.td.org.uit.no>
Subject: Re: Newbie extraction question
Message-Id: <xn667q070ew.fsf@spurv.td.org.uit.no>
> I don't
> want to strip the tags as many examples have shown on the net.
Uhm ... you want to set $title to "<title>Title name here</title>",
not "Title name here"?
> say variables $title and $author. The problem is, my title may be very
> long, ie. over multiple lines, so I guess I'm wondering as to how to do
> this.
That's no problem at all - at least not if efficieny isn't an issue
(...and if it really is, you should use C instead). I've even had
complete text files inserted into single variables.
Hm, simple regexping poses a problem, it's normally done
line-by-line. IMHO, the example from Mark Mielke seemed a little bit
complicated for such an easy task. I'll try some easier approach (NB!
This is both untested and a quick'n'dirty approach!):
while (<>) {
# Single lined title:
if (/<title>(.*)<\/title>/i) {$title=$1;}
# Start of a multilined title:
else if (/<title>(.*)$/i) {$title=$1; $opentitle=1;}
# continuing a multilined title:
else if ($opentitle) {
# ending a multilined title:
if (/^*.<\/title>/i) {$title.=$1; $opentitle=0;}
# the whole line is a member of the multilined title:
else {$title.=$_;}
}
}
echo $title;
If I haven't done any huge mistakes (but I always do!) this tiny
script extracts the title (without the tags) from the standard
input. A similar approach may be taken for extracting the author
field. cut'n'paste is the quickest, the more "correct" would be to
make a function.
Feel free to flame me by email if it doesn't work or if you have
problems using it.
> I realize this is probably one of those posts which produces instant
> frowns, and I apologize for that, just hoping someone might be able to
> help me out.
Uhm...something like: "How dare you insist perl cannot handle
multilined string variables???" :)
I've been using emacs, unix, perl, C++ and a lot of other tools,
systems and standards for several years. Somebody regards me as an
expert, but I really have a talent making stupid newbie questions and
assertions myself.. :) And, yes, it really is easier to ask in a
newsgroup than to read the manuals through when having a simple query.
--
Tobias Brox - tobix@abex.no - http://www.cs.uit.no/~tobias
------------------------------
Date: 11 Nov 1997 00:05:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbie extraction question
Message-Id: <6487gj$1n9$1@comdyn.comdyn.com.au>
In article <Pine.SOL.3.96.971110161400.3239A-100000@sol.sun.csd.unb.ca>,
ASHFIELD M <a15d@unb.ca> writes:
> I am trying to
> write a script that will extract text from between HTML tags.
Use the HTML::Parse module
Get it from CPAN (start at www.perl.com.CPAN)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use being
NSW, Australia | a damn fool about it.
------------------------------
Date: 10 Nov 1997 14:57:25 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: newbie having trouble with install
Message-Id: <6483gl$9qu$1@shell3.ba.best.com>
In article <346788c4.95370289@news.crossover.com>,
David Storrs <dstorrs@crossover.com> wrote:
>but that didn't accomplish anything. I was sort of hoping that there
>was a nice, friendly, "type-a-line-watch-it-be-interpreted" sort of
You can coerce perl into running in the debugger mode, which allows you
to do interactive input, examine the values of things, and so forth.
Normally, you'd do this using the command "perl -d script". However, you
can force Perl to go right into the debugger by giving it a "fake" script
on the command line (using the -e switch). So, you should be able to say
perl -de 42
(or any other number, besides 0), which should work. (It works on UNIX;
I don't run Windows, so I don't know if it works there.)
You might also think about getting Gurusamy Sarathy's Windows Perl port,
if that's not the one you're running; from what I understand, it's more
complete than the other one that's out there. You can get it from
http://www.perl.com/perl/CPAN
or your local CPAN mirror (a list of which can be found there).
Hope this helps.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: Mon, 10 Nov 1997 19:27:05 -0800
From: Christian Mallwitz <mallwitz@intershop.de>
Subject: Perl 5.004_02 for NT and SIGINT
Message-Id: <3467D089.C09BAE65@intershop.de>
Hi folks,
Could someone explain why I have to press ^C twice to abort the folowing script
----------------------------------------
$SIG{'INT'} = \&sig_handler; # set signal handler to catch ^C
while (1) {}
sub sig_handler
{
my($signal) = @_;
print STDERR "SIG$signal caught -- shutting down ...\n";
}
----------------------------------------
What's even worse is than if the last the statement in the sub sig_handler is
exit(0); it crashes. Using a Solaris box only one ^C is necessary and it doesn't
crash if the exit(0) is in the signal handler sub.
I guess that's a bug ...
Cheers
Christian
------------------------------
Date: Mon, 10 Nov 1997 17:55:17 -0800
From: Christian Mallwitz <mallwitz@intershop.de>
To: Gurusamy Sarathy <gsar@engin.umich.edu>
Subject: Perl 5.004_02 for NT bind() bug
Message-Id: <3467BB05.48AAE5E5@intershop.de>
Hi folks,
I think what I have found is definitly a bug with Perl 5.004_02 for NT.
Executing the following script twice beside each other should give you an error
message with the second script saying 'address already in use' (as it actually
is on a LINUX system I tested). On NT there is no error message and both script
try to listen on the same port. Only one script is reciving incomming requests.
Here is the script
------------------------------
use Socket;
my($port) = 11111;
my($sockaddr) = 'Sna4x8';
my($proto) = (getprotobyname('tcp'))[2];
my($this) = pack($sockaddr, AF_INET, $port, "\0\0\0\0");
socket(S, AF_INET, SOCK_STREAM, $proto) || die "socket: $!";
setsockopt(S, SOL_SOCKET, SO_REUSEADDR, 1) || die "setsockopt: $!";
bind(S, $this) || die "bind: $!";
listen(S, 5) || die "connect: $!";
print STDERR "\nListening for connection on $port ...\n";
while (1) {
print STDERR "\nready to accept connection ...\n";
(my($addr) = accept(NS, S)) || die "accept: $!";
shutdown(NS, 1); # 1 == SD_SEND
close(NS) || die "Can't close NS: $!\n";
print STDERR "accepted.\n";
}
------------------------------
I have looked at win32/win32sck.c and it seems to be ok.
The bug is present in ActiveState's perl 5.003 (build 312) as well as
win32/win32sck.c is copied over from them (I think).
Any suggestions ?
Christian
------------------------------
Date: 11 Nov 1997 02:38:15 GMT
From: cowbys@aol.com (COWBYS)
Subject: Re: Problem with read
Message-Id: <19971111023800.VAA03268@ladder01.news.aol.com>
I need to be able read the file
line by line. The SMTP command line
utility I am using wont let me insert the
file as the actual message contents if I try to pass
it @records instead of reading each line and
appending it to the message contents. Thats why
Im reading it into an array first, and then reading
each line from the array, the seek ensures I read
the whole line and no more. If you can suggest
a better way, Im open .... DCF
------------------------------
Date: Mon, 10 Nov 1997 18:27:14 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: SQL statement in Perl
Message-Id: <2p8846.mu2.ln@localhost>
Henry Hartley (henry@DotRose.com) wrote:
: I'm working on an Intranet '411' application for my company. I have a
: Perl script that looks up data in a MS Access database depending upon
: what the user enters into the five fields. It MOSTLY works. What I
: can't get to work is the sorting of the data. I have the following SQL
: statment (the first line part is all one line):
: $sql = sprintf("select * from phonebook where LastName like '%s'
: and FirstName like '%s' and Extension like '%s' and Building like '%s'
: and Room like '%s' order by '%s'", $lastname . "\%", $firstname . "\%",
: $exten . "\%", $bldg . "\%", $roomnum . "\%", $sortby);
: $query->Sql($sql);
At least write it so you'll be able to read it.
It will make a big difference when you are trying to figure it out
after not seeing the code for a few weeks/months:
$sql = "select * from phonebook "
. "where LastName like '$lastname%' "
. "and FirstName like '$firstname%' "
. "and Extension like '$exten%' "
. "and Building like '$bldg%' "
. "and Room like '$roomnum%' "
. "order by '$sortby'";
or
$sql=<<ENDSQL;
select * from phonebook
where LastName like '$lastname%'
and FirstName like '$firstname%'
and Extension like '$exten%'
and Building like '$bldg%'
and Room like '$roomnum%'
order by '$sortby'
ENDSQL
$sql =~ s/\n/ /g; # newline ==> space
print "\$sql='$sql'\n";
: This returns the correct data but the "order by $sortby" portion seems
: to do nothing.
Sounds like either an SQL or Access question.
Perl is doing what you told it to do.
Maybe you are not telling it to do whatever Access wants you to tell
it to do.
Ask Access questions in some newsgroup related to Access, such as:
comp.databases.ms-access
: $sortby contains one of the field names from the Access
: table. Any suggestions?
So where is your _perl_ question?
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 10 Nov 1997 23:01:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Timezone conversion
Message-Id: <6483o9$1fk$1@comdyn.comdyn.com.au>
In article <comdog-ya02408000R0911972330590001@news.panix.com>,
comdog@computerdog.com (brian d foy) writes:
> In article <645qo3$pem$3@comdyn.comdyn.com.au>,
> mgjv@comdyn.com.au (Martien Verbruggen) wrote:
>
>
>>look at time(), localtime() and gmtime().
>>
>>time always returns the number of seconds since epoch, GMT (except
>>maybe on a mac...),
>
> it does for a Mac as well, for certain values of epoch. perhaps
> january 1, 1970 deserves to be the proper noun, "Epoch", and then
> the usual Apple version "MacEpoch" :)
I was referring to the manual entry:
Returns the number of non-leap seconds since whatever time the system
considers to be the epoch (that's 00:00:00, January 1, 1904 for MacOS,
and 00:00:00 UTC, January 1, 1970 for most other systems). Suitable
for feeding to gmtime and localtime.
This doesn't mention that the Mac Epoch is also standardised on
GMT/UTC, and since I don't know much about Macs I didn't want to
presume it was :)
If it is defined to be 00:00:00 UTC, January 1, 1904, maybe the docs
should be modified slightly :), if someone can confirm the Mac Epoch
time definition, I'll submit a report.. (I can't seem to find a
definition including the time zone anywhere)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: Tue, 11 Nov 1997 01:30:54 GMT
From: Guy Doucet <gdoucet@ait.acl.ca>
Subject: Re: Updating current HTML page with Perl CGI... HELP!!
Message-Id: <3467B4BD.A4F4A400@ait.acl.ca>
Maybe I should have mentionned that our site is run by Novell Web Server.
But I really can't (overwrite) the current HTML page. In fact, I can create
any other file (and I have), almost everywhere on the server. In fact I even
called an intermediate HTML page from the first page. This intermediate page
calls the Perl script and even then it won't overwrite the first HTML
document.
But nontheless, I took somebody's advice of removing that HTML page and
creating it on the fly.
Thanks for all.
Guy Doucet
------------------------------
Date: Mon, 10 Nov 1997 16:33:57 GMT
From: scemama@doubt.com (Fabrice Scemama)
Subject: Re: Year2000 problem with localtime();
Message-Id: <3275a641.125514219@news.hol.fr>
On Fri, 24 Oct 1997 11:54:36 +0100, Peter Meighan
<pmeigh01@cork.cig.mot.com> wrote:
>Hi y'all,
> Of the values returned by localtime, the $year value is coming out
>as '97'. Is there a plan to change this to `1997`? It's something that
>could cause *major* problems, don't you think?
At least, give localtime a try with a >=2000 year.
You'll see that localtime will handle it properly.
If 1997 is written as 97, well, 2017 is
written as 117. Example: 01/01/2017 -> 01/01/117 .
No big deal, you still have to add 1900.
/Fabrice Scemama (France)
http://www.gesnet.net
------------------------------
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 1298
**************************************