[8757] in Perl-Users-Digest
Perl-Users Digest, Issue: 2374 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 21 20:07:32 1998
Date: Tue, 21 Apr 98 17:01:37 -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, 21 Apr 1998 Volume: 8 Number: 2374
Today's topics:
Re: SendMail on NT (Andy Lester)
Re: Symbolic ref and angle opeator (Mark-Jason Dominus)
Testing <charlene.yanke@sait.ab.ca>
Testing <charlene.yanke@sait.ab.ca>
There *IS* a visual IDE for Perl! seeker79@yahoo.com
Re: There *IS* a visual IDE for Perl! <bruce@cenderis.demon.co.uk>
Re: Time : Year2000 & 2038 code question (I R A Aggie)
Re: Time : Year2000 & 2038 code question (Mark-Jason Dominus)
Re: Time : Year2000 & 2038 code question (Abigail)
Re: Time : Year2000 & 2038 code question (I R A Aggie)
Re: Time : Year2000 & 2038 code question (Abigail)
Re: Time : Year2000 & 2038 code question <pas@unh.edu>
Re: VB DLL and Perl <msergeant@ndirect.co.uk>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Apr 1998 15:19:06 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: SendMail on NT
Message-Id: <6hidda$jmr$1@supernews.com>
: : > I'm switching from a Unix system to a NT system and I have to convert all my
: : > perl cgi scripts over. I was wondering if there is a module I can use on NT
: : > that would replace Unix's "sendmail".
I don't suppose you did a search in any searchengines on "sendmail and
NT".
xoxo,
Andy
--
--
Andy Lester: <andy@petdance.com> http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com> http://ChicagoMusic.com/
------------------------------
Date: 21 Apr 1998 11:18:19 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Symbolic ref and angle opeator
Message-Id: <6hidbr$r29$1@monet.op.net>
Keywords: assert Corbett du impoverish
In article <iQ0%.714$D13.4738127@news3.voicenet.com>,
Matt Knecht <hex@voicenet.com> wrote:
>I'm having a problem trying to get a symbolic reference to work with
>the angle operator.
>$line = <${$files{file1}}{filehandle}>;
Hi. I'm going to quote from the manual.
Perlop:
> If the string inside angle brackets is not a filehandle or a
> scalar variable containing a filehandle name or reference,
> then it is interpreted as a filename pattern to be globbed,
Well, it's a little ambiguous. By `filehandle' it doesn't mean `some
expression that evaluates to a filehandle' but rather `bare word
filehandle like STDIN'.
Anyway, in your case, the string inside the engle brackets is neither
a bare word filehandle like STDIN, nor a scalar variable. It's a
comnplex expression, and guess what? It's being interpreted as a glob
pattern.
You have two options:
1. Use the `readline' operator, which is the same as <...> but
with more ordinary syntax.
2. Store the filehandle into a temporary variable and then use <$temp>
------------------------------
Date: Tue, 21 Apr 1998 09:39:23 -0600
From: Charlene Yanke <charlene.yanke@sait.ab.ca>
Subject: Testing
Message-Id: <353CBDAB.1107@sait.ab.ca>
This is only a test.
------------------------------
Date: Tue, 21 Apr 1998 09:22:01 -0600
From: Charlene Yanke <charlene.yanke@sait.ab.ca>
Subject: Testing
Message-Id: <353CB999.69E2@sait.ab.ca>
This is just a test please ignore.
------------------------------
Date: Tue, 21 Apr 1998 16:35:39 -0600
From: seeker79@yahoo.com
Subject: There *IS* a visual IDE for Perl!
Message-Id: <6hj3fc$ps3$1@nnrp1.dejanews.com>
Hi everyone,
I have been lurking around here for a while and have seen a number of people
ask about editors/IDE's for Perl. I just wanted to post a note that I just
found a complete IDE for Perl called "Perl Builder."
I have only worked with it a little while so far, but it looks great. It is
very similar to VC++, it has color coding, you can set breakpoints in the
editor, and it even has the little yellow pop-ups that show variable values.
Also lets you run cgi scripts w/o a webserver and see the results.
Anyway, you can download it from http://www.solutionsoft.com/perl.htm.
Enjoy!
David Seeker
SeekTech Development
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 21 Apr 1998 23:03:40 +0100
From: Bruce Stephens <bruce@cenderis.demon.co.uk>
Subject: Re: There *IS* a visual IDE for Perl!
Message-Id: <m34szm25oj.fsf@cenderis.demon.co.uk>
seeker79@yahoo.com writes:
> I have only worked with it a little while so far, but it looks great. It is
> very similar to VC++, it has color coding, you can set breakpoints in the
> editor, and it even has the little yellow pop-ups that show variable values.
> Also lets you run cgi scripts w/o a webserver and see the results.
>
> Anyway, you can download it from http://www.solutionsoft.com/perl.htm.
The screenshot looks pretty. So, is it good enough that it would be
worth using Windows 95 (or, assuming I had it, NT), which is not my
favourite development environment. (Does *anybody* who's developed
under Unix *prefer* Windows 95?)
What are the chances of some nice Unix graphical debugger? (Caveat, I
haven't tried the Perl/Emacs debugger thingy recently. What certainly
used to be missing, and is missing for C/C++ debuggers too (with the
honorable exception of DDD) is a really nice data examiner, letting me
click on pointers to dereference them and things.)
------------------------------
Date: Tue, 21 Apr 1998 11:22:19 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <fl_aggie-2104981122200001@aggie.coaps.fsu.edu>
In article <6hi5to$5fd$2@news1.news.iol.ie>, tmoran@iol.ie (Tony Moran) wrote:
+ Hi, in reviewing perl code for compliancy, I came across this in
+ a function that calls localtime() and then does:
+
+ $year += ($year < 70) ? 2000 : 1900;
+
+ I know the below is right,
+
+ $four_digit_year = 1900 + $year;
+
+ but why would the author of the first line of code
+ want to add back 2000 on to the integer returned
+ by localtime().
Because he made the presumption that anything returned that was
less than 70 would be in the next century, instead of reading
the manpage on localtime(); ??
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 21 Apr 1998 12:04:48 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <6hig30$rel$1@monet.op.net>
Tony Moran <tmoran@iol.ie> wrote:
> Hi, in reviewing perl code for compliancy, I came across this in
> a function that calls localtime() and then does:
>
> $year += ($year < 70) ? 2000 : 1900;
In article <1d7tzkz.171m2y71dk1s0xN@roxboro0-025.dyn.interpath.net>,
John Moreno <phenix@interpath.com> wrote:
>whoever was doing this was trying to be paranoid (always a good thing)
>but didn't think things out...unfortunately if the right thing IS done, his
>program will fail.
No, it won't. If, in 2005, `localtime' yields 105, the way it's
supposed to, then he correctly translates the 105 to 2005. Neither
you nor the other guy who answered the question in this thread saw
this.
The only time this can fail is if for some reason `$year' initially
holds a number that represents a year earlier than 1970. Then the
code will interpret the year incorrectly as a next-century year rather
than a this-century year. If $year always comes from localtime, that
can't happen because it's 1998 now.
>And possibly he wasn't paranoid enough - if the script could possibly be
>ported to the mac, then it's possible to have a year less than 70 now
Yes, but not as a localtime. Unless, as you note, the clock is
mis-set. So the question becomes: Is it more important to operate
correctly when the clock is mis-set, or in the presence of a broken
localtime implementation?
There's some tradeoff here. There are two conditions, leading to six
possible universes:
* You might have a good localtime, or you might have a broken one that
returns 10 in year 2010.
* The year might be before 1970, or it might be between 1970 and 1999,
or it might be after 2000.
-1970 1970-2000 2000+
Bad localtime X Y
Good localtime X
`Y' here means that the correct code, $year+=1900, will produce the
wrong result, because it has been sabotaged by the broken `localtime'.
`X' here means that the variant code above, $year += ($year < 70 ?
2000 : 1900), will produce the wrong result, because it is broken.
Now, suppose you thought for some reason that you would be dealing
with a bad localtime. That means that at least some of the time you
will be living in the top row of the table. The correct code will
break in the year 2000.
On the other hand, the variant code that the programmer used will
never break, although it would have been broken in 1969. But it
isn't 1969 and it isn't going to be.
The programmer might believe himself or herself to be in the top row
of the table for any of several reasons, some good, some bad. Bad
reason: ``You mean, that isn't the way localtime is supposed to
work?'' Good reason: ``But I know my program has to run under the
NanoTech OU operating system, which *does* have a broken localtime.'
Let's think of the programmer with a good reason for a minute. If
some Studebaker fancier resets the system clock to say it's 1907
again, the variant code breaks. In this case the programmer must say
``Sorry. My program wasn't designed to work in 1907. It's a
consequence of NanoTech OU's broken localtime function; I could have
it work in 1907 or 2007, but not both, so I made it work in 2007. Fix
your clock to show the correct date.''
If this programmer had used the correct code, they might have to say
in 2001: ``Sorry that my program thinks it's 1901, but NanoTech OU has
a broken date library. I knew this, and I could have worked around
it, but I didn't. Tough luck.''
If I were this programmer, I would prefer to say the first thing.
Of course, it's more likely that the programmer didn't know what they
were doing, but I don't think you can conclude that from this code
fragment.
------------------------------
Date: 21 Apr 1998 16:10:57 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <6higeh$mfm$3@client3.news.psi.net>
Tony Moran (tmoran@iol.ie) wrote on MDCXCIV September MCMXCIII in
<URL: news:6hi5to$5fd$2@news1.news.iol.ie>:
++ Hi, in reviewing perl code for compliancy, I came across this in
++ a function that calls localtime() and then does:
++
++ $year += ($year < 70) ? 2000 : 1900;
++
++ I know the below is right,
++
++ $four_digit_year = 1900 + $year;
++
++ but why would the author of the first line of code
++ want to add back 2000 on to the integer returned
++ by localtime().
++
++ What could cause that integer to possibly be lower
++ than 70 in the first place ?
Negative values for time(), or low positive values and a timezone
west of GMT. That still doesn't mean that adding 2000 is right though.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Tue, 21 Apr 1998 12:07:15 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <fl_aggie-2104981207150001@aggie.coaps.fsu.edu>
In article <Pine.A41.3.96.980421102928.70330D-100000@ginger.libs.uga.edu>,
Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
+ If I'm reading this right, the author knows that the year will not be less
+ than 70 until the year 2000, when the year will be '00'.
Ummm...No. From 'perldoc -f localtime' we see:
> Also, $year is the number of years since 1900, that is, $year is 123
> in year 2023.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 21 Apr 1998 16:17:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <6higr4$mfm$4@client3.news.psi.net>
Brad Baxter (bmb@ginger.libs.uga.edu) wrote on MDCXCIV September MCMXCIII
in <URL: news:Pine.A41.3.96.980421102928.70330D-100000@ginger.libs.uga.edu>:
++ If I'm reading this right, the author knows that the year will not be less
++ than 70 until the year 2000, when the year will be '00'. Therefore, he is
++ adding 2000 instead of 1900.
You are wrong.
$ perl -wle 'print +(localtime 2 * 365 * 24 * 3600 + time) [5]'
100
$
Of course, the manual would have told you so as well.
Abigail
--
perl -pwle '$_ .= reverse'
------------------------------
Date: 21 Apr 1998 16:26:40 GMT
From: Paul A Sand <pas@unh.edu>
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <6hihc0$p8a@mozz.unh.edu>
tmoran@iol.ie (Tony Moran) writes:
>Hi, in reviewing perl code for compliancy, I came across this in
>a function that calls localtime() and then does:
> $year += ($year < 70) ? 2000 : 1900;
[...]
>What could cause that integer to possibly be lower
>than 70 in the first place ?
My guess is that this was an effort to be (ummm...)``compliant'' with
the perl-version-4 way of doing things. For example, the perl-4.036
version of ctime.pl had exactly that line. (I remember thinking that
was a bug even then, and changing it to `$year += 1900'.)
--
-- Paul A. Sand | Refusing to live in the real world will
-- University of New Hampshire | substantially reduce the portability of
-- pas@unh.edu | your code.
-- http://pubpages.unh.edu/~pas | (Henry Spencer)
------------------------------
Date: Tue, 21 Apr 1998 17:14:31 +0100
From: Matt Sergeant <msergeant@ndirect.co.uk>
Subject: Re: VB DLL and Perl
Message-Id: <353CC5E7.BAD84D67@ndirect.co.uk>
scott@softbase.com wrote:
>
> Steve (TC100@t-online.de) wrote:
> > I wrote a xxx.DLL in Visual Basic. Now I have to use this program for
> > my server. ..... I must open
> > the xxx.dll, an then I need the access to the methods an objects
> > defined in the xxx.dll.
>
> You need to make the DLL an ActiveX object that supports Automation.
> I'm not a VB expert by any means, but it looks like VB can do this.
Alternatively get your hands on Win32::API - it allows you to call
functions in DLL's direct from Perl. Very powerful. Check Activestate's
web site for a reference, or http://reference.perl.com .
Matt.
------------------------------
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 2374
**************************************