[7159] in Perl-Users-Digest
Perl-Users Digest, Issue: 784 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 27 12:07:16 1997
Date: Sun, 27 Jul 97 09:00:25 -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 Sun, 27 Jul 1997 Volume: 8 Number: 784
Today's topics:
[Q] Read/Write Microsoft CVS files.... <ricky@ornet.co.il>
ANYONE KNOW OF A GOOD BOOK FOR LEARNING PERL (DanitoFool)
Re: ANYONE KNOW OF A GOOD BOOK FOR LEARNING PERL <fp@pmpcs.com>
Re: Array n dimensions (RTFM! :-) (Ken Fox)
Re: Can I send a fax through cgi? (Tony Bowden)
Re: Can somebody explain how this works? (Ken Fox)
Re: CGI.pm file uploads with Internet Explorer (Raul Almquist)
Re: deleteing (Clay Irving)
Re: deleteing <malunjkars@aol.com>
Re: File Locking and Procmail (Lutz Albers)
Get FREE PASSWORD TO 2000 SEX SITE.... gary099g@erols.com
HELP!!! HELP!!! HELP!!! HELP!!! <deputy-_-dawg@msn.com>
Help: perl cgi <cascioli@geocities.com>
Re: Idea for a New Perl Book (Jon Bell)
Re: Idea for a New Perl Book (Jonathan Feinberg)
Installing module without having privledges <jason@watson.ibm.com>
Re: MailTools-1.09 modules <kjj@primenet.com>
Need a good Time sub routine (Burt Lewis)
Need help with Objects (Dave Pavlich)
non-arrogant gurus (was Re: Too many people...) <Russell_Schulz@locutus.ofB.ORG>
Perl and MS-DOS or Win 3.11 <rfernand@internet.com.uy>
Re: python envy ? (Danny Aldham)
Response Headers <alta@tab.com>
Solaris 2.4 - Perl 5.004.01 (Neil Briscoe)
Re: Syslog -- help please (Paul Rose)
tania seek hunk helen@safci.uk
Unix time, local time, year 2000 question. <wwalton@ee.net>
Re: Unix time, local time, year 2000 question. (Abigail)
Re: Unix time, local time, year 2000 question. (Neil Briscoe)
Re: Unix time, local time, year 2000 question. (Paul Eggert)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 27 Jul 1997 14:34:50 +0300
From: Ricardo Marek <ricky@ornet.co.il>
Subject: [Q] Read/Write Microsoft CVS files....
Message-Id: <33DB325A.41C67EA6@ornet.co.il>
Hello,
Does someone has a package/script for reading and writting CSV formated
files into a perl-script? I'm sure someone has allready implemented
a bunch of functions that deal with CSV files. (or package for it)
Please answer via e-mail to ricky@ornet.co.il.
BTW Why to re-invent the wheel?
Tia.
--
--- Ricky -*- Mode: Another-Unix-Hacker -*-
------------------------------------------------------------------------------
--- e-mail: ricky@ornet.co.il ORNET Data Communication
Technologies Ltd.
--- http://w3.ornet.co.il/~ricky (A Siemens Company)
------------------------------------------------------------------------------
- "With a PC, I always felt limited by the software available.
- On Unix, I am limited only by my own knowledge." -- Peter J.
Schoenster
------------------------------
Date: 27 Jul 1997 04:09:11 GMT
From: danitofool@aol.com (DanitoFool)
Subject: ANYONE KNOW OF A GOOD BOOK FOR LEARNING PERL
Message-Id: <19970727040900.AAA24785@ladder01.news.aol.com>
I am looking for a good book or online manual to learn perl from, please
help and e-mail me back if you know of any?
------------------------------
Date: 27 Jul 97 14:25:31 GMT
From: "Peter Perchansky" <fp@pmpcs.com>
Subject: Re: ANYONE KNOW OF A GOOD BOOK FOR LEARNING PERL
Message-Id: <01bc9a98$e81db9e0$51fa2581@pmp>
Greetings:
"I am looking for a good book or online manual to learn perl from, please
help and e-mail me back if you know of any?"
Look at our Perl book recommendation page at
http://www.pmpcs.com/books/perl.htm
--
===========================================================
Peter Perchansky, Computer Consultant & Microsoft FrontPage MVP
PMP Computer Solutions
FrontPage Web Hosting at http://www.pmpcs.com/services/fpwebhosting.htm
FrontPage Support http://www.pmpcs.com/support/frontpage.htm
------------------------------
Date: 27 Jul 1997 02:28:31 GMT
From: fox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Array n dimensions (RTFM! :-)
Message-Id: <5rebof$2sj3@eccws1.dearborn.ford.com>
In article <33D8C1F0.456D@astro.estec.esa.nl>,
Uwe Lammers <Uwe.Lammers@astro.estec.esa.nl> writes:
>
> Jerome Quelin wrote:
> > How can I use (or simulate ?) array of n dimensions ?
> > How can manipulate them ?
>
> [...] This is used to mimic multi-dim arrays in Perl which are not
> natively supported.
He should have answered with "read the manual!" At least that would have
been a *correct* answer... You'll find out how to make a multi-dimensional
array (or "List of Lists") in the perllol man page. Here's an example
from the first page of the manual:
| A list of lists, or an array of an array if you would, is just a regular
| old array @LoL that you can get at with two subscripts, like C<$LoL[3][2]>.
| Here's a declaration of the array:
|
| # assign to our array a list of list references
| @LoL = (
| [ "fred", "barney" ],
| [ "george", "jane", "elroy" ],
| [ "homer", "marge", "bart" ],
| );
|
| print $LoL[2][2];
| bart
Only works with Perl 5. (Do we even need to say that anymore?)
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: 27 Jul 1997 14:30:36 GMT
From: tony@niweb.com (Tony Bowden)
Subject: Re: Can I send a fax through cgi?
Message-Id: <5rfm2c$cod$1@sparc.tibus.net>
Tom Phoenix (rootbeer@teleport.com) wrote:
: Can you send the text of a something you want faxed through a CGI script?
: Yes, you can. Will it come out of a FAX machine somewhere? That's
: possible, too. Do I have a script sitting around which will make this work
: with your hardware? No, I don't. Hope this helps!
Actually, if you check out http://www.tpc.int/ then you may be able to
find an email address for the fax machine, in which case this becomes a lot
more trivial ;)
Tony
--
-----------------------------------------------------------------------------
Tony Bowden | tony@tmtm.com / t.bowden@qub.ac.uk / http://www.tmtm.com/
Belfast, NI | i am just a relic, i am just a petrified cry
-----------------------------------------------------------------------------
------------------------------
Date: 27 Jul 1997 02:56:00 GMT
From: fox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Can somebody explain how this works?
Message-Id: <5redc0$2sj4@eccws1.dearborn.ford.com>
In article <yl3u3hhbdgm.fsf@shell8.ba.best.com>,
Robert Nicholson <steffi@shell8.ba.best.com> writes:
> This is from Paul Lucas's filtmail scripts
>
> $Headers =~ s/\n\s+/ /g;
This joins all lines beginning with spaces to the previous line. For
example, the following:
From: me
To: you
and them
and others
gets converted to:
From: me
To: you and them and others
> %Header = ( 'FRONTSTUFF', split( /^(\w[-\w]+):\s+/m, $Headers ) );
This splits the headers into <attribute, value> pairs and loads the
result into a hash. The 'FRONTSTUFF' key is necessary because the split
will create a (probably empty) first field that isn't a header attribute.
The pattern given to split will match an alphanumeric (i.e. \w) at the
beginning of a line followed by one or more alphanumeric or dash characters
followed by a colon followed by one or more spaces. Since parentheses are
used in the pattern, split takes the parenthesized portion of the match
and returns it with the split-up fields.
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: Sat, 26 Jul 1997 22:47:03 -0600
From: strider@ShadowMAC.org (Raul Almquist)
Subject: Re: CGI.pm file uploads with Internet Explorer
Message-Id: <strider-ya02408000R2607972247030001@news.winternet.com>
In article <33D269E0.7F22@icl.fi>, petri.backstrom@icl.fi wrote:
> Duncan Halstead wrote:
> >
> > Does anyone know if there is an easy way to do file uploads with
> > Internet Explorer? CGI.pm makes file uploads really easy assuming that
> > you are using netscape 2.0 or better, but I have seen nothing similar
> > for Internat Explorer.
>
> Search http://www.microsoft.com for rfc1867.exe; with Microsoft
> InternetExplorer 3.02 it'll give you the file upload support (and
> it is better than Netscape Navigator since it doesn't default to
> *.html files ;-).
Shows you don't know what you are talking about... default indeed.
We upload files just fine thank you, and they are NOT html files!
The default is not Netscape Navigator's, it is however the processing cgi
or script or module that sets any such default.
------------------------------
Date: 26 Jul 1997 22:12:29 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: deleteing
Message-Id: <5reaqd$ru5@panix.com>
In <33DA666A.F7591E9D@netwalk.com> Brian Thibault <thibault@netwalk.com> writes:
>How do I delete a whole line of text from a file when I only know what
>the line starts with.
1. Open the file.
2. Open a temporary file.
3. Unless the line matches the string you're looking for, print it to
the temporary file.
4. Move the temporary file to the original file
5. Close the files.
--
Clay Irving <clay@panix.com> http://www.panix.com/~clay/
------------------------------
Date: Sun, 27 Jul 1997 01:55:36 -0700
From: Sanjay <malunjkars@aol.com>
Subject: Re: deleteing
Message-Id: <33DB0D08.53C9@aol.com>
Brian Thibault wrote:
>
> How do I delete a whole line of text from a file when I only know what
> the line starts with.
> It is for a deluser script.
>
> Thanks in advance,
> Please respond by email
> Brian Thibault
if your filename is say /etc/passwd
then use the following script:
open(PASSWD,"/etc/passwd");
my $user_to_be_delted='someuser';
my @remaining_users=map {!/^$user_to_be_delted/ ? $_ :()} <PASSWD>;
print @remaining_users;
close(<PASSWD>);
Please note that this program may not be good for very large files
as it loads the entire file in the memory. but you get the idea,right?
------------------------------
Date: Sat, 26 Jul 1997 11:53:37 +0200
From: lutz@muc.de (Lutz Albers)
Subject: Re: File Locking and Procmail
Message-Id: <lutz-ya023480002607971153370001@news>
In article <rsmithEDw903.IDw@netcom.com>, rsmith@netcom.com (Richard S.
Smith) wrote:
>When I do "procmail -v" I get the following:
>
> Locking strategies: dotlocking, fcntl()
>
>Does this mean I have to do *both* of these things? I'm aware of the
>fcntl() function in perl, as well as "use Fcntl", but do I need to do more?
Better check the procmail sources to see what is required.
>Next question: My script does an initial scan of the file (to get an
>article count), closes it, and then re-opens it to kill the old articles.
>Can I close, and then re-open a file without losing the fcntl-style lock?
>Or am I reliant on dot-locking in this case?
The loose the lock upon closing. Better open the file R/W and seek back to
the beginning after the first pass.
>I'm running Perl 5.003 on Freebsd 2.1.7, Procmail v3.11pre4.
You should upgrade to perl5.004_01, it has some changes regarding flock
(and setuid scripts will work again on FreeBSD :-)
ciao
lutz
--
Lutz Albers, lutz@muc.de, pgp key available from <http://www.pgp.net>
Do not take life too seriously, you will never get out of it alive.
------------------------------
Date: 27 Jul 1997 05:13:20 GMT
From: gary099g@erols.com
Subject: Get FREE PASSWORD TO 2000 SEX SITE....
Message-Id: <5reldg$5pu@news1-alterdial.uu.net>
http://www.2bornot2b.com/password
Protect Your Children From Viewing ADULT XXX Material
and at the same time get UNLIMITED FREE ACCESS to
over 1200 of the Hottest Adult Sites on the Web.
Also get FREE UNLIMITED Live Video Sex and FREE XXX
rated chat room access.
Stop paying to get into Adult Sites. This secret password gets
you into them for FREE!!!
I posted all the info at the URL above.
------------------------------
Date: Sun, 27 Jul 1997 01:14:10 -0700
From: "Stephen T. Cerniglia" <deputy-_-dawg@msn.com>
Subject: HELP!!! HELP!!! HELP!!! HELP!!!
Message-Id: <01bc9a65$a5ea4760$7ac82399@default>
To whom reads,
HELP!!! I finally found a webmaster that will allow me to post PERL
scripts and they are for some reason not working... I know the script work
because I downloaded them from Matt's PERL Script Archive... I followed
all instruction and I get prompt with a page:
500 Server Error
Here is all the information that the server gave me:
You can use CGI program with perl 5.0
This server does not support cc or gcc compiler.
The path is "/usr/local/bin/perl".
perl script can be excuted in everywhere under your "public_html"
directory.
SSI (Server side include) must use file extension ".shtml".
If your want to use server's CGIWRAP,
create "cgi-bin" directory under "public_html" directory.
All excutable program must be in "cgi-bin".
When "500 server error!" has occured, check the file permission.
Mode "755" is recommandable.
$ chmod 755 filename
I create the CGI-BIN and made it "755" as suggested above (and all
files)... I edited the scripts as added with server paths and
information... Though nothing seems to work... If anyone can help me out,
thanks... As you can see I never used this stuff before!!!
P.S. - If you need the script just ask and I'll send it to your e-mail
address... (I can't post the script on a newsgroup)
-Stephon
------------------------------
Date: Sun, 27 Jul 1997 13:16:48 +0200
From: ".70 Andreas 07." <cascioli@geocities.com>
Subject: Help: perl cgi
Message-Id: <33DB2E1F.B0782CDC@geocities.com>
I was wondering how to execute a javascript (script.js) from a perl cgi?
Could anyone help pls?
Andreas
------------------------------
Date: Sun, 27 Jul 1997 05:52:58 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Idea for a New Perl Book
Message-Id: <EDyr0A.Epr@presby.edu>
In article <5rd24d$8ih@news-central.tiac.net>,
Mike Stok <mike@stok.co.uk> wrote:
>
>ETA: 4Q97 probably means estimated time of arrival fourth quarter of 1997,
>so it should be soon with the caveats that publishing companies and
>authors use the word "estimated" advisedly :-)
That is, just the way that programmers and/or their managers use it.
:-) :-)
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
------------------------------
Date: 27 Jul 1997 11:35:59 GMT
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Idea for a New Perl Book
Message-Id: <5rfbqv$nfb$1@gte1.gte.net>
> Title: "The Perl Cookbook" [tentative]
> Author: Tom Christiansen and Nathan Torkington.
> Publisher: O'Reilly
My vote for the cover: a simmering pot of Camel stew.
--
Jonathan Feinberg jdf@pobox.com Sunny Manhattan, NY
------------------------------
Date: Wed, 23 Jul 1997 21:43:38 -0400
From: othernane <jason@watson.ibm.com>
Subject: Installing module without having privledges
Message-Id: <33D6B34A.B9DCB1CC@no.spam.com>
I have access to several *nix machines that have perl installed, but
none have
LWP installed. I've tried to do a conventional install of LWP on these
machine, but the install keeps on trying to put files in directories in
which I
don't have write privledges.
Is there a way for me to install these modules elsewhere and have them
work
normally?
Thanks,
J.
------------------------------
Date: 27 Jul 1997 07:11:00 -0700
From: Kevin Johnson <kjj@primenet.com>
Subject: Re: MailTools-1.09 modules
Message-Id: <m2afj8k2k7.fsf@primenet.com>
Oksana Lien <lien@ares.csd.net> writes:
> I'm looking for 2 small sample scripts that use the MailTools-1.09
> modules. Although I'm working on it, my understanding of Perl's
> object-oriented constructs is weak and thats where my problems lie.
>
> I'm on Sun Solaris 2.51.
>
> Ex 1: A loop that opens mail and prints every message to standard out.
> Ex 2: A loop that opens mail and forwards messages.
The Mail::Folder module uses the MailTools modules quite a bit. You
might want to take a look there. In particular, take a look at the
example scripts provided.
--
thx,
kjj@pobox.com http://www.pobox.com/~kjj/
------------------------------
Date: 27 Jul 1997 10:50:14 GMT
From: burt@ici.net (Burt Lewis)
Subject: Need a good Time sub routine
Message-Id: <5rf956$pij$1@bashir.ici.net>
Hi,
I'm looking for a good time sub routine that will display the time in AM and
PM terms.
Like 12:33 AM or 11:59 PM.
Appreciate any help on this and also thank you to everyone who has helped me
on my other questions. This group is fantastic!
Burt Lewis
burt@ici.net
------------------------------
Date: Sun, 27 Jul 97 15:43:14 GMT
From: dpavlich@neo.lrun.com (Dave Pavlich)
Subject: Need help with Objects
Message-Id: <5rfqak$flm@akron5.neo.lrun.com>
Keywords: objects, hash
I'm attempting to parse a fixed length file that contains addresses and info
for a person. (One record per person). The parse is working fine but
the'store and retrevial' is giving me problems. My goal, once stored, is to
sort these records based on a field.
Have have little (or should I say NO) experience with Objects and am having
a difficult time . Please help !
Can someone give me an example. ?
For this example; you can assume that I have $name, $number etc already
populated with info from the record.
Thanks - Dave
----
dpavlich@neo.lrun.com
------------------------------
Date: Sun, 27 Jul 1997 08:54:15 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: non-arrogant gurus (was Re: Too many people...)
Message-Id: <19970727.085415.2R4.rnr.w164w_-_@locutus.ofB.ORG>
bart.mediamind@tornado.be (Bart Lateur) writes:
> When retrieving new headers, I automatically download all postings by
> Randal. I like his style. I hardly even bother to look at the rest of
> the postings.
>
> So it IS possible to be a Perl guru without being a prick.
at first, there were only two posters I'd antikilled in
c.l.p.misc. Randal was consistently useful and/or entertaining
(or he was posting intentionally obscure one-liners, which I can
ignore). the other one used to be useful, but started frothing
and threatened to intentionally unmunge people's addresses to
help spammers, and then left the newsgroup.
of course, there ARE other useful people here; GroupLens and its ilk
would probably be helpful in finding them. I find them now by
following interesting Subject:-based threads, and seeing who gives
interesting (and plausibly correct) answers.
I personally don't MIND people correctly answering newbie-oriented
questions which are NOT in the FAQ, because it will probably either:
- teach me the answer
- show me another way of teaching someone else the answer
I also don't care much for the `if we just quote the FAQ instead of
having 20 people post almost-right answers, we will never have new
insights and we'll stagnate' rubbish some posters seem to love.
and finally, it WOULD be nice to see Larry post here again. but
what would this accomplish? Larry spending a bunch of time away
from his family and friends and work, dealing with a lot of lazy
people who ask him questions they could have easily found elsewhere.
maybe the best thing the newsgroup could do in this regard would be
to organize a human volunteer `filter Larry's news' service, so that
he COULD read the group (and his already-filtered news-followup mail)
without wasting so much time...
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Sun, 27 Jul 1997 06:23:51 -0700
From: Rafael Fernandez <rfernand@internet.com.uy>
Subject: Perl and MS-DOS or Win 3.11
Message-Id: <33DB4BE7.35B2@internet.com.uy>
Hi:
I'm learning perl for programming cgi, but i have some problems.
I work in a 486 dx4, in DOS and Win 3.11. I could edit my scripts and I test
them with perl.exe. But I want them to print a html page on my browser, and i couldn't
yet. ?Is it posible? I mean sending a document to the browser (I use Netscape) locally
(from my HD). I don't know how to do it.
Bye.
Rafael Fernandez
Montevideo - Uruguay
rfernand@internet.com.uy
------------------------------
Date: 25 Jul 1997 21:42:17 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: python envy ?
Message-Id: <5rbv79$5mp$1@lennon.postino.com>
Linux Enthusiast (brett@teleport.com) wrote:
: Except become as ubiquitous as java, unfortunately :-(
Last time I checked, Perl ran on a lot more platforms than Java.
--
Danny Aldham SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.
------------------------------
Date: 27 Jul 97 06:10:59 GMT
From: "ALTA RESEARCH" <alta@tab.com>
Subject: Response Headers
Message-Id: <01bc9a5b$bd5818a0$1d4eaacf@miked>
I know how to use environmental variables generated by the "Request
Headers". Are there environmental variables generated by "Response
Headers"?
Specifically, I am trying to determine when a page has successfully loaded.
Visual Basic has a command for "Navigation Complete". Is there a similar
command or methodology within PERL?
I am writting a program that access web pages. I don't want to pause the
program for a number of seconds in hopes that the web page loads. I want
to know when the page has loaded succesfully. Is there an environmental
variable I can test for?
Mike
------------------------------
Date: 27 Jul 1997 10:44:09 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Solaris 2.4 - Perl 5.004.01
Message-Id: <memo.19970727114408.1055A@skep.compulink.co.uk.cix.co.uk>
Hi,
I attempted to make and install 5.004.01 today.
It compiled fine, but fails on the test op/socket - giving the
message :-
Bad file number at lib/io_sock.t at line 55.
It doesn't die at that point, but didn't seem to be doing
anything else, so I suspect the test may have hung.
Anyway I can fix this?
I built the perl using GCC under Sparc Solaris 2.4.
Regards
Neil
------------------------------
Date: 27 Jul 1997 12:06:19 +0100
From: paul@rose-garden.demon.co.uk (Paul Rose)
Subject: Re: Syslog -- help please
Message-Id: <5rfa3b$fhc$1@rose-garden.demon.co.uk>
In article <869941571.217456@proteus.cantech.net.au>,
Anthony J. Breeds-Taurima <tony@poseidon.canningcollege.wa.edu.au> wrote:
>Aaron Sherman (ajs@lorien.ajs.com) wrote:
>
>: Your problem is not with perl, but with your system
>: configuration. Look at /etc/syslog.conf or the equiv. on your system,
>: and see if you have routed *.info anywhere.
>
>I have to admit I did think it was a problem with my system. I checked
>/etc/syslog.conf and *.info is routed to /usr/adm/messages (this is the file
>i've been looking in)
Hi,
I had a similar problem with using syslogd, and found that I had
not setup syslogd to accept messages from the network. This is done
by starting syslogd with the -r switch (I think). You may need to
change how syslogd is invoked, in the older versions this was
the default, so I guess you'll need to check the manpage. The
following is from the 'man syslogd' -
8<--------------------------------------------------------
-r This option will enable the facility to receive
message from the network using an internet domain
socket with the syslog service (see services(5)).
The default is to not receive any messages from the
network.
8<--------------------------------------------------------
hth,
Paul.
+- Paul Rose --------------- paul@rose-garden.demon.co.uk -+
| PGP Key Available, PGP KeyID: E42BB85D |
+---------------------------- www.rose-garden.demon.co.uk -+
------------------------------
Date: 27 Jul 1997 13:35:04 GMT
From: helen@safci.uk
Subject: tania seek hunk
Message-Id: <870010489.60869@angel.comcen.com.au>
hi guys check this out!!!
http://www.sexmansion.com
pics of me!
love,
cindy
------------------------------
Date: Sun, 27 Jul 1997 01:46:08 -0400
From: Lynn Walton <wwalton@ee.net>
Subject: Unix time, local time, year 2000 question.
Message-Id: <33DAE0A0.236B@ee.net>
I was surprised, when I stumbled upon a sentence I hadn't noticed before
in the camel book (p. 185) where it says "the year field returned from
localtime has had 1,900 subtracted from it." I guess I had thought
that the first 2 digits were just dropped. If the book is correct, I
would expect it to return the number 100 in the year 2000.
Meanwhile, I have written code under the assumption that it would just
return the 2 digits 00 ? Does anyone know this for sure?
And for a trivia question, does anyone know when the 32bit number for
unix time will overflow? When it does, will the function time return a
valid number (although it will not be the number of seconds since Jan 1
1970 anymore) or will it return undefined?
Thanks in advance,
Lynn
------------------------------
Date: Sun, 27 Jul 1997 06:49:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Unix time, local time, year 2000 question.
Message-Id: <EDytn7.4E5@nonexistent.com>
Lynn Walton (wwalton@ee.net) wrote on 1426 September 1993 in
<URL: news:33DAE0A0.236B@ee.net>:
++ I was surprised, when I stumbled upon a sentence I hadn't noticed before
++ in the camel book (p. 185) where it says "the year field returned from
++ localtime has had 1,900 subtracted from it." I guess I had thought
++ that the first 2 digits were just dropped. If the book is correct, I
++ would expect it to return the number 100 in the year 2000.
++
++ Meanwhile, I have written code under the assumption that it would just
++ return the 2 digits 00 ? Does anyone know this for sure?
$ perl -wle 'print +(localtime (time + 3 * 365 * 24 * 3600))[5]'
100
Now, that wasn't hard to test, was it?
You've less than 2.5 years to fix the bugs in your code. Let's hope
you don't have millions of lines....
++ And for a trivia question, does anyone know when the 32bit number for
++ unix time will overflow? When it does, will the function time return a
++ valid number (although it will not be the number of seconds since Jan 1
++ 1970 anymore) or will it return undefined?
Another hard issue to test:
$ perl -wle 'print scalar localtime 0x7FFFFFFF'
Mon Jan 18 22:14:07 2038
Of course, the real question is, is your hardware by that time
still 32 bits? Whether time () will return a valid number or undef
over more than 40 years is a bit hard to predict. If you want to
find out what your computer does, advance the system clock to
Jan 19, 2038 and try.
A few oddities on my platform:
The roll over doesn't seem to happen till a few hours later:
$ perl -wle 'print scalar localtime (0x8000383F)'
Tue Jan 19 03:14:07 2038
$ perl -wle 'print scalar localtime (0x8000383F + 1)'
Fri Dec 13 20:45:52 1901
However, there's an extra leap of an hour after the roll over:
$ perl -wle 'print scalar localtime (0x7FFFFFFF + 1)'
Mon Jan 18 23:14:08 2038
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 27 Jul 1997 07:07:41 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Unix time, local time, year 2000 question.
Message-Id: <memo.19970727080740.5007A@skep.compulink.co.uk.cix.co.uk>
In article <33DAE0A0.236B@ee.net>, wwalton@ee.net (Lynn Walton) wrote:
> I was surprised, when I stumbled upon a sentence I hadn't noticed before
> in the camel book (p. 185) where it says "the year field returned from
> localtime has had 1,900 subtracted from it." I guess I had thought
> that the first 2 digits were just dropped. If the book is correct, I
> would expect it to return the number 100 in the year 2000.
>
> Meanwhile, I have written code under the assumption that it would just
> return the 2 digits 00 ? Does anyone know this for sure?
>
I very recently wrote a script on my firewall which worked based on that
very sentence. Since the string I have to pass to the postgres database
needs a four digit year, I do a :-
$year += 100;
rather than
$year = "19$year";
as I might have been inclined to do.
I'd dearly like to know if this code is going to keel over and die on New
Year's day 2000. I have a comment in the code on that line that reads :-
#millenium?
Now seems a good time to find out, if possible.
Regards
Neil
------------------------------
Date: 27 Jul 1997 01:25:09 -0700
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: Unix time, local time, year 2000 question.
Message-Id: <5rf0l5$f9s$1@shade.twinsun.com>
abigail@fnx.com (Abigail) writes:
>A few oddities on my platform:
>The roll over doesn't seem to happen till a few hours later:
>However, there's an extra leap of an hour after the roll over:
Those bugs are common in SVR4-based platforms.
E.g. they're in Solaris 2.5.1 (even with the latest patches).
------------------------------
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 784
*************************************