[8773] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2389 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 22 13:37:35 1998

Date: Wed, 22 Apr 98 10:31:41 -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           Wed, 22 Apr 1998     Volume: 8 Number: 2389

Today's topics:
        Status of c.l.p.moderated (Danny Aldham)
    Re: Status of c.l.p.moderated <merlyn@stonehenge.com>
    Re: Status of c.l.p.moderated (gaj)
    Re: suggested research methods? - THANK YOU! <dtbaker_@flash.net>
    Re: suggested research methods? - THANK YOU! <dtbaker_@flash.net>
        suggested research methods? <dtbaker_@flash.net>
    Re: suggested research methods? <sneaker@earthling.net>
    Re: suggested research methods? <sneaker@earthling.net>
    Re: suggested research methods? <jdf@pobox.com>
    Re: suggested research methods? <jdporter@min.net>
    Re: suggested research methods? <jdporter@min.net>
    Re: suggested research methods? (Stuart McDow)
    Re: suggested research methods? (Tad McClellan)
    Re: suggested research methods? <sneaker@earthling.net>
    Re: suggested research methods? (Malcolm Hoar)
    Re: suggested research methods? <ebohlman@netcom.com>
    Re: SUIDPERL <rootbeer@teleport.com>
        Support Group for Compiled PERL?? <deepak@bondsmith.com>
    Re: Symbolic ref and angle opeator <quentin@jihad.amd.com>
        Text formating (Joonas Timo Taavetti Kekoni)
    Re: Time : Year2000 & 2038 code question (Abigail)
    Re: Time : Year2000 & 2038 code question (John Moreno)
    Re: Time::Local (timegm) doesn't handle dates beyond Ja (Jonathan Stowe)
        trouble with MLDBM's evals <otis@POPULUS.net>
    Re: UNIX mail script (Martien Verbruggen)
    Re: unpacking multiple binary shorts (WORDS) <scalise@dvdo.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 19 Apr 1998 15:10:00 GMT
From: danny@lennon.postino.com (Danny Aldham)
Subject: Status of c.l.p.moderated
Message-Id: <6hd448$p63$1@lennon.postino.com>

X-Newsreader: TIN [version 1.2 PL2]

What is the status of comp.lang.perl.moderated.? Can we expect
to see it any time soon?

--
Danny Aldham             SCO Ace, MCSE, JAPH, DAD 
Field Service Manager    BCTel Systems Support
7000 Lougheed Hwy, Burnaby BC   (604) 444-8949


------------------------------

Date: Mon, 20 Apr 1998 12:28:21 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
To: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Status of c.l.p.moderated
Message-Id: <8cogxw8ypr.fsf@gadget.cscaper.com>

>>>>> "Danny" == Danny Aldham <danny@lennon.postino.com> writes:

Danny> What is the status of comp.lang.perl.moderated.? Can we expect
Danny> to see it any time soon?

The revised RFD is being posted to news.groups "any day now".  There'l
be some discussion, then a voting period, then a tabulation period,
then a group creation etc etc.  Figure at least two months from now.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Tue, 21 Apr 1998 23:08:37 GMT
From: gjandl@rf.mnschoolbiz.com (gaj)
Subject: Re: Status of c.l.p.moderated
Message-Id: <353d2694.21460531@news.spacestar.net>

On 19 Apr 1998 15:10:00 GMT, danny@lennon.postino.com (Danny Aldham)
wrote:

>X-Newsreader: TIN [version 1.2 PL2]
>
>What is the status of comp.lang.perl.moderated.? Can we expect
>to see it any time soon?

Good question. I've been checking news.groups often in hopes of seeing
the updated RFD. Or have we let this one slip by us again? (ie. past
the deadline.)


------------------------------

Date: Mon, 20 Apr 1998 11:38:50 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: Re: suggested research methods? - THANK YOU!
Message-Id: <353B882A.7474@flash.net>

thanx to John and Andrew, they had some very helpful pointers!


John Porter wrote:
> 
> Dan Baker wrote:
> >
> > As a newbie faced with a directory full of docs, faqs, and a bookshelf
> > of perl reference books, I find it a daunting task to find where to
> > start researching a question...
> 
 ...snip
> I hit the Camel and Panther books most often.
> They're well indexed and cover some advanced topics.
> 
> Wrt modules, what I find myself doing very often is loading the
> "large, hyperlinked description of CPAN" (/pub/perl/CPAN/CPAN.html)
> and doing text searches within it. It also contains a TOC for itself.
> When you need something a little more esoteric, consult the "long list"
> (/pub/perl/CPAN/modules/00modlist.long.html).
> 
> The Perl FAQ is viewable online in one large file (272k) at
> /pub/mirrors/CPAN/doc/FAQs/FAQ/PerlFAQ.html
> I prefer this, since I like to search the entire FAQ at once.
> If you have a slow connection, you might prefer the separate
> pages. There's also links to other good sources of info on the
> FAQ page, http://language.perl.com/faq/index.html
--------------------

John, thanks for the helpful hints! I know it will help me, and hope it
will help other newbies...
I did get another great response from A. Johnson with a nice little grep
tool... I've included the highlights here for everyone's benefit:

in case you might want to try out the basic faqgrep script:

basic usage:
    faqgrep 'pattern'
    prints on STDOUT, the list of questions containing the pattern
    prependend by the filename it was found in.
    
    faqgrep -f 'pattern'
    prints on STDOUT, the entire FAQ blurb for every question
    containing 'pattern'
example:
[danger:ajohnson:~]$ faqgrep sort
perlfaq4.pod:=head2 How do I sort an array by (anything)?
perlfaq4.pod:=head2 How do I sort a hash (optionally by value instead of
key)?
perlfaq4.pod:=head2 How can I always keep my hash sorted?
[danger:ajohnson:~]$ faqgrep -f 'hash sorted'
=head2 How can I always keep my hash sorted?

You can look into using the DB_File module and tie() using the
$DB_BTREE hash bindings as documented in L<DB_File/"In Memory
Databases">.

[danger:ajohnson:~]$

for nicer formatting, you can always pipe the output
through pod2text

here is the script (36 lines)...the path to the pod directory
is hardcoded, so you'll have to change it appropriately.
(probably many improvements could be made---like creating a single
file with all the faq questions in it to grep through...possibly
with filename and offsets to the actual location--- but its
simple and works fast enough on my system so...)

enjoy
andrew

---cut faqgrep---
#!/usr/bin/perl -w
use strict;
# NOTE:change the $faqdir to point to your pod directory
my $faqdir="/usr/local/perl5.004_04/pod";

my $opt=shift @ARGV if $ARGV[0]=~/-f/;
my $pattern=$ARGV[0];
opendir(FAQDIR,$faqdir)||die "can't open $faqdir: $!";
my @faqs=grep /faq/,readdir FAQDIR;
close FAQDIR;
if ($opt) {
   get_faq();
} else {
   grep_faq_heads();
}
sub grep_faq_heads {
    foreach my $faq (@faqs) {
        open(FAQ,"$faqdir/$faq")||die "can't open $faq: $!";
        while (<FAQ>) {
            print "$faq:$_" if /^=head.*?$pattern/;
        }
        close FAQ;
    }
}
sub get_faq {
    my($n);
    foreach my $faq (@faqs) {
        open(FAQ,"$faqdir/$faq")||die "can't open $faq: $!";
        while (<FAQ>) {
            $n=1 if /^=head.*?$pattern/;
            $n=0 if /^=head(?!.*?$pattern)/;
            print if $n;
        }
        close FAQ;
    }
}
__END__


------------------------------

Date: Mon, 20 Apr 1998 13:26:26 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: Re: suggested research methods? - THANK YOU!
Message-Id: <353BA162.26CE@flash.net>

one more belated thank you to J. Feinberg... he actually replied with
some great information first but for some reason my newsreader (or ISP
download) never listed his response! I didn't find it until checking the
entire thread with DejaNews...

So, thanx again to everyone who has responded so far, and thanks in
advance to plan to later, and sorry if I missed anyone. I'm sure the
group will continue to be stunned and amazed if you have additional
research tricks you'd like to contribute.


D


------------------------------

Date: Sun, 19 Apr 1998 17:47:11 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: suggested research methods?
Message-Id: <353A8CFF.25A9@flash.net>

As a newbie faced with a directory full of docs, faqs, and a bookshelf
of perl reference books, I find it a daunting task to find where to
start researching a question...

Most commonly I am thinking I know that this must have been done before,
and it's probably either in a FAQ or there is an entire module written
that does what I need.... but WHERE??? I hate the feeling that 99% of
the time the answer to the question I have is already local on my
hard-drive, but i can't find it!

My questions to the group are : 

- where do you start? what specific docs do you start with to ferret out
the info you need?

- do you find yourself going to a particular reference book (which
one(s)?).... or online docs most often?

- if you have a feeling there is a module that handles your task, but
can't remember the name, or want to learn more about the
capabilities/limitations... how do you FIND the appropriate module?

- once you find a module that may do what you want; how do you study up
on it? look at source? look at pod?

 ...please teach me to fish...

Dan


------------------------------

Date: Tue, 21 Apr 1998 21:02:32 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: suggested research methods?
Message-Id: <353D07CB.F1AD24F0@earthling.net>

lvirden@cas.org wrote:

> Sometimes, having paper
> to read is useful.
>
> Bill, do you mean that you printed out every pod on CPAN?  Or the long
> version of the 'catalog' of CPAN modules that are available?  I suspect
> the latter...

The latter :-)

When I printed it, I wanted to mark-up a copy as I 'explored' things.

I should be more explicit, sorry.  What really makes me mad is - I've
already misplaced it and will have to get the 'long version again.'

No biggie, it is on-line, ya'll know?  ;-)



------------------------------

Date: Mon, 20 Apr 1998 00:33:51 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: suggested research methods?
Message-Id: <353A9655.6C00B8D4@earthling.net>

Dan Baker wrote:

> My questions to the group are :
>
> - where do you start? what specific docs do you start with to ferret out
> the info you need?

War is hell, make sure your weapons are of the latest release.In the world
of high tech, only those with the best will survive.

As far as a 'particular' area to start - What interests you?
Research that...

> - do you find yourself going to a particular reference book (which
> one(s)?).... or online docs most often?

(under 5.004) try perldoc perldoc ,a Perl 5 by Example (red book), and
Perl 5 Desktop Reference
The above will be a good start...
(I am not advocating reading the
man perl pages right off the rip...)

> - if you have a feeling there is a module that handles your task, but
> can't remember the name, or want to learn more about the
> capabilities/limitations... how do you FIND the appropriate module?

I try to 'read' CPAN as often as possible...(I printed out the 'long'
version...)
Also, I believe I saw a Perl Developers
book by Jon Orwant(?)  listed every
Module in existince...  $34.95
I believe, published by Active Press(?)

> - once you find a module that may do what you want; how do you study up
> on it? look at source? look at pod?

This, unfortunately, is a problem on an author by author basis.Mostly,
however, each author has examples documented
in the POD which may come with the module; otherwise
rip the Modules apart and tinker with them.  If all else fails,
ask the author.  Offer food, it may help  :-)
(My opinion concerning Module documentation and
examples, mind you...)

> ...please teach me to fish...
>
> Dan

 I had blackened flounder for the
first time Satuday night, it was
pretty good :-)
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|




------------------------------

Date: 19 Apr 1998 22:14:52 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: suggested research methods?
Message-Id: <d8ed421f.fsf@mailhost.panix.com>

Dan Baker <dtbaker_@flash.net> writes:

> - where do you start? what specific docs do you start with to ferret out
> the info you need?

First: the perldoc command.  You'll want to start with

   $ perldoc perl

which gives you the layout of the entire manual.  Then do

   $ perldoc perlfaq

to see the organization of the 9 FAQ lists.

Finally, to see the documentation for a particular Perl builtin, you'd
say

   $ perldoc -f print
   $ perldoc -f split

> - do you find yourself going to a particular reference book (which
> one(s)?).... or online docs most often?

The manpages (those things you read with perldoc) are the Torah; The
"blue Camel" (_Programming Perl_, 2nd Edition) is the Talmud.

A DejaNews search on comp.lang.perl.misc may well be the best online
resource; it contains the collected wisdom and vitriol of all of us.
Make sure you use the "power search" features to restrict your search
to c.l.p.m..  I also recommend threaded results.  www.perl.com also
has pointers to such delicacies as tchrist's authoritative FMTEYEWTK
series (that's "Far More Than Everything You Ever Wanted To Know").

> - if you have a feeling there is a module that handles your task, but
> can't remember the name, or want to learn more about the
> capabilities/limitations... how do you FIND the appropriate module?

One elegant way is to use the CPAN module.

    $ perl -MCPAN -e shell

    cpan shell -- CPAN exploration and modules installation (v1.27)
    Readline support available (try ``install Bundle::CPAN'')

    cpan> i /somepattern/

This means "give me info about modules whose name matches
somepattern."  You can also view

    http://www.perl.com/CPAN-local/CPAN.html

> - once you find a module that may do what you want; how do you study up
> on it? look at source? look at pod?

Once you have installed a module (say, for example, CPAN.pm (hint,
hint)), you get the documentation with

    $ perldoc CPAN

I hope this helps.  I'm gonna go see a poetry reading.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


------------------------------

Date: Mon, 20 Apr 1998 12:46:34 GMT
From: John Porter <jdporter@min.net>
Subject: Re: suggested research methods?
Message-Id: <353B44F5.2E46@min.net>

Bill 'Sneex' Jones wrote:
> 
> Dan Baker wrote:
> 
> > - where do you start? what specific docs do you start with to ferret out
> > the info you need?
> 
> As far as a 'particular' area to start - What interests you?
> Research that...

This obviously does not answer Dan's question.  He's not looking
for a subject area, he's looking for indices, TOCs, top-level
documents.


> I try to 'read' CPAN as often as possible...(I printed out the 'long'
> version...)

YOU PRINTED IT OUT?
What in hell would possess someone to do something so stupid?
It strips the document of almost all of its usability: you can't
do text searches within it, you can't follow links from it, and
it doesn't automagically get updated.


> Also, I believe I saw a Perl Developers
> book by Jon Orwant(?)  listed every
> Module in existince...  $34.95
> I believe, published by Active Press(?)

With all due respect to Jon, this suffers the same problems as
printing out the CPAN long listing yourself. It's not quite as
bad, since it includes short usage statements.


> otherwise
> rip the Modules apart and tinker with them. 

I have never had to do this. 
(Sure, I've done it for fun, but that's not the same thing.)


John Porter


------------------------------

Date: Mon, 20 Apr 1998 13:06:00 GMT
From: John Porter <jdporter@min.net>
Subject: Re: suggested research methods?
Message-Id: <353B4986.64BC@min.net>

Dan Baker wrote:
> 
> As a newbie faced with a directory full of docs, faqs, and a bookshelf
> of perl reference books, I find it a daunting task to find where to
> start researching a question...

I think it's essential to be well-practiced in grepping through the
directory full of files.  Try phrasing your need various ways, if
you're not getting hits.

One top-level doc which ought to be mentioned is perltoc.

> - do you find yourself going to a particular reference book (which
> one(s)?).... or online docs most often?

I hit the Camel and Panther books most often.
They're well indexed and cover some advanced topics.

Wrt modules, what I find myself doing very often is loading the
"large, hyperlinked description of CPAN" (/pub/perl/CPAN/CPAN.html)
and doing text searches within it. It also contains a TOC for itself.
When you need something a little more esoteric, consult the "long list"
(/pub/perl/CPAN/modules/00modlist.long.html).

The Perl FAQ is viewable online in one large file (272k) at
/pub/mirrors/CPAN/doc/FAQs/FAQ/PerlFAQ.html
I prefer this, since I like to search the entire FAQ at once.
If you have a slow connection, you might prefer the separate
pages. There's also links to other good sources of info on the
FAQ page, http://language.perl.com/faq/index.html
I especially like the FMTEYEWTK.

hth,
John Porter


------------------------------

Date: 20 Apr 1998 23:01:44 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: suggested research methods?
Message-Id: <6hgk4o$die$1@ns1.arlut.utexas.edu>

Bill 'Sneex' Jones <sneaker@earthling.net> writes:
>
> Besides, what the hell else am I gonna read while taking a crap?!
> :D

Too true. I've been trying to get people around here interested in
buying some really cheap X-terminals to install in the restroom
stalls. Unfortunately, we'd have to network the restroom first.

:-)

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
  "It is obvious that about 750,000 people ago, Austin was a wonderful City."


------------------------------

Date: Mon, 20 Apr 1998 19:09:23 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: suggested research methods?
Message-Id: <j3ogh6.fl2.ln@localhost>

Stuart McDow (smcdow@arlut.utexas.edu) wrote:
: Bill 'Sneex' Jones <sneaker@earthling.net> writes:
: >
: > Besides, what the hell else am I gonna read while taking a crap?!
: > :D

: Too true. I've been trying to get people around here interested in
: buying some really cheap X-terminals to install in the restroom
: stalls. Unfortunately, we'd have to network the restroom first.

: :-)


In that case, we may need to update some of the Frequently Asked Questions:


"How do I flush..."

"How do I strip..."

"Where can I get a list of Larry Wall witticisms?" (those walls are 
                                                    so bare)
"What ... extensions are available..."

"How do I do (anything)?"      ( anything = 'do' )

"How can I use curses..."

"What is undump?"

"Is there a leak/bug in glob()?"

"How do I find out if I'm running..."

"How do I make sure users can't enter..."



Of course, people _still_ wouldn't read the FAQ...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 21 Apr 1998 00:35:19 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: suggested research methods?
Message-Id: <353BE82B.A11F88E0@earthling.net>

Tad McClellan wrote:

> "What is undump?"
>

I am not sure, but unless IO::Pipes
are clogged, why would you want to?!  :D

:-)




------------------------------

Date: Tue, 21 Apr 1998 00:39:42 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: suggested research methods?
Message-Id: <6hgpsf$r3p$1@nntp1.ba.best.com>

In article <j3ogh6.fl2.ln@localhost>, tadmc@flash.net (Tad McClellan) wrote:

>In that case, we may need to update some of the Frequently Asked Questions:
>
>"How do I flush..."

[snip]

Hmmmm. Time for comp.lang.perl.tasteless? ;-)

-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar           "The more I practice, the luckier I get". |
| malch@malch.com                                     Gary Player. |
| http://www.malch.com/               Shpx gur PQN.                |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


------------------------------

Date: Tue, 21 Apr 1998 05:30:05 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: suggested research methods?
Message-Id: <ebohlmanErr0M5.488@netcom.com>

Malcolm Hoar <malch@malch.com> wrote:
: In article <j3ogh6.fl2.ln@localhost>, tadmc@flash.net (Tad McClellan) wrote:

: >In that case, we may need to update some of the Frequently Asked Questions:
: >
: >"How do I flush..."

: [snip]

: Hmmmm. Time for comp.lang.perl.tasteless? ;-)

Would that be where you'd discuss issues like whether 
IO::Socket::SpoogeDonor and IO::Socket::SpoogeReceptacle are better uses of 
module namespace than IO::Socket::Spooge::Donor and 
IO::Socket::Spooge::Receptacle?

Going back to the bathroom issue and the FAQ issue, and given that 
there's a module for "sexing" names, can anyone confirm that FAQAskers 
are particularly likely to be male?  If so, then maybe we should do some 
memetic engineering and try to start a UL that reading the FAQ and the 
docs will increase your endowment in more ways than just intellectually...



------------------------------

Date: Wed, 22 Apr 1998 00:52:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: "G. E. Terry" <admin@net-ops.net>
Subject: Re: SUIDPERL
Message-Id: <Pine.GSO.3.96.980421174932.21174o-100000@user2.teleport.com>

On Tue, 21 Apr 1998, G. E. Terry wrote:

> Subject: SUIDPERL

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> I keep getting the error message:
> 
> Insecure $ENV{ENV} while running setsuid at .........Line 19 chunk 2

Have you seen what perldiag says about this?

> #! /usr/bin/perl -wU

If you don't know what you're doing, you probably shouldn't use -U. If you
use -U, you probably don't know what you're doing. :-) 

> open (UID, ">.uid");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

> $sid = `cat .sid`;

Hmmm....

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Mon, 20 Apr 1998 19:02:26 -0700
From: deepak <deepak@bondsmith.com>
Subject: Support Group for Compiled PERL??
Message-Id: <6hgu83$ose@bgtnsc03.worldnet.att.net>

Hi-

Where can I get some pointers on the alpha 3 perl compiler?  I am trying
to compile some scripts that "use NDBM_File."  Tripping on the "-u"
compile option...and wondering why I can't tie my hash to a file from
machine code.

Thanks,
Deepak


------------------------------

Date: 22 Apr 1998 09:01:33 -0500
From: Quentin  Fennessy <quentin@jihad.amd.com>
Subject: Re: Symbolic ref and angle opeator
Message-Id: <xim90oyez0i.fsf@jihad.amd.com>


>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:

    Tom> Lamentably, the circumfix operator sometimes called the
    Tom> diamond operator, especially when used without a
    Tom> interchangeably.  I know this sucks.  I know it seems to make

Cool term.  Circumfix.  Not in either dictionary I tried, but I
found it at (and a few other places):

	http://wwwots.let.ruu.nl/~Hans.Leidekker/lexicon/ll_c.html

I like this better than `discontinuous affix.'  Yeesh.

Are there other programming constructs that can be described as
circumfix?  Of course the parens in function calls might be so
described.  LISP parens too.

-- 
Quentin Fennessy			AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals


------------------------------

Date: 20 Apr 1998 23:18:26 GMT
From: jkekoni@cc.hut.fi (Joonas Timo Taavetti Kekoni)
Subject: Text formating
Message-Id: <6hgl42$ebp$3@hiekkalaatikko.cs.hut.fi>

I wish to create printer output for multi culumn text or table.
What choises I have?

1. create text and use nenscript?
+simple
-requires nenscript (a problem with non unix?)
-very limited,
	* 1 to 2 culumns from nenscript more using format/write.
	* wide borders
	* only courrier format
-require PS printter/rip

2. print pod format text and then use some tool. What?

3. Write html table and print using web browser.
- can't do exaclt formating, can't control page breaks.

4. write directly ps/<some>tex/sgml 
- requires knowledge for that languge

5. some perl module, I don't know?

-- 
	_-  Joonas Kekoni       OH2MTF	    I                           -_
	_-internet:	jkekoni@cc.hut.fi   I       DO NOT EAT.         -_
	_-slowmail:	j{mer{ntaival 7a176 I                           -_
	_-		02150Espoo          I      It is a monitor      -_
	_-		Finland/Europe      I                           -_


------------------------------

Date: 21 Apr 1998 20:30:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <6hivke$r7h$1@client3.news.psi.net>

John Moreno (phenix@interpath.com) wrote on MDCXCIV September MCMXCIII in
<URL: news:1d7u7mb.1rj7zdk10juxq1N@roxboro0-025.dyn.interpath.net>:
++ Mark-Jason Dominus <mjd@op.net> wrote:
++ 
++ > 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.
++ 
++ Actually I did see it and misspoke (but how are you to realize that?).
++ It does fail in so much as it is useless - it looks to me like he was
++ trying to account for a failure in localtime after 2038 (quite a bit of
++ it now would choke on a 2040 time and return a year of 2 - but I expect
++ all of those to be fixed in the next 40 years).  If it is fixed then it
++ never get's called.   If it's NOT fixed then the date it gives will be
++ 2002 in 2040.

Well, first of all, if you are right, then the solution doesn't make
sense. Even if year would return 2, "2002" would still be 38 years
off. Sure, that's a smaller error than 138 years, but there are only
a few people that can tolerate dates to be off by 38 years.

However, you are wrong. Observe:

    $ perl -wle 'print scalar gmtime ((1 << 31) - 1)'
    Tue Jan 19 03:14:07 2038
    $ perl -wle 'print scalar gmtime ((1 << 31))'
    Fri Dec 13 20:45:52 1901
    $ perl -wle 'print scalar gmtime ((1 << 31) + 1)'
    Fri Dec 13 20:45:53 1901

It'll wrap, but it will jump 136 years back. So, if you want to correct,
you need to do a lot more than just adding an extra 100 years.



Abigail
-- 
perl -pwle '$_ .= reverse'


------------------------------

Date: Tue, 21 Apr 1998 22:41:19 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Time : Year2000 & 2038 code question
Message-Id: <1d7ukbu.13ag0svrod59zN@roxboro0-025.dyn.interpath.net>

Abigail <abigail@fnx.com> wrote:

> John Moreno (phenix@interpath.com) wrote on MDCXCIV September MCMXCIII in
> <URL: news:1d7u7mb.1rj7zdk10juxq1N@roxboro0-025.dyn.interpath.net>:
> ++ Mark-Jason Dominus <mjd@op.net> wrote:
> ++ 
> ++ > 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.
> ++ 
> ++ Actually I did see it and misspoke (but how are you to realize that?).
> ++ It does fail in so much as it is useless - it looks to me like he was
> ++ trying to account for a failure in localtime after 2038 (quite a bit of
> ++ it now would choke on a 2040 time and return a year of 2 - but I expect
> ++ all of those to be fixed in the next 40 years).  If it is fixed then it
> ++ never get's called.   If it's NOT fixed then the date it gives will be
> ++ 2002 in 2040.
> 
> Well, first of all, if you are right, then the solution doesn't make
> sense.

That's what I was trying to say (I'm not doing a very good job of this
today, maybe I should give up).  If everything works the way it's
supposed to it's useless, if it doesn't work the way it's supposed to
it's still wrong.

> Even if year would return 2, "2002" would still be 38 years
> off. Sure, that's a smaller error than 138 years, but there are only
> a few people that can tolerate dates to be off by 38 years.

Yes - and not only that it makes it more likely that the problem will be
a personal problem, as it's more likely to be argued over (it'd be
easier to get the IRS to believe that it's made a mistake in saying that
you haven't paid your taxes for 138 years than that you hadn't paid them
for 38 [assuming that you're over 58]).  For a lot of things a 38 year
period could be correct, much fewer for a 138 year period.

> However, you are wrong. Observe:

So you think it was to deal with a specific version with a broken
localtime?
 
>     $ perl -wle 'print scalar gmtime ((1 << 31) - 1)'
>     Tue Jan 19 03:14:07 2038
>     $ perl -wle 'print scalar gmtime ((1 << 31))'
>     Fri Dec 13 20:45:52 1901
>     $ perl -wle 'print scalar gmtime ((1 << 31) + 1)'
>     Fri Dec 13 20:45:53 1901
> 
> It'll wrap, but it will jump 136 years back. So, if you want to correct,
> you need to do a lot more than just adding an extra 100 years.

The above doesn't work on my system (it's a mac and uses all 32 bits for
the time, starting 1/1/1904) and there's some problem with the
conversion, but this does basically what you were trying to show:

$\="\n";
print;

$endtime=4294952896;
print scalar gmtime ($endtime-1);
print scalar gmtime ($endtime);
print scalar gmtime ($endtime+1);

Gives:

Mon Feb  6 06:28:15 2040
Fri Jan  1 00:00:00 1904
Fri Jan  1 00:00:01 1904

Of course to get these results our hypothetical user would have to be
running the program on a 40 year old computer using 40 year old
software, this IS going to be fixed soon (in fact I believe it already
has, it's just that MacPerl hasn't been updated to take advantage of it
yet - if it hasn't been fixed in twenty years I'm going to complain
rather LOUDLY).

-- 
John Moreno


------------------------------

Date: Tue, 21 Apr 1998 14:48:33 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Time::Local (timegm) doesn't handle dates beyond Jan 1, 2038??
Message-Id: <353cad1c.16303991@news.btinternet.com>

On Mon, 20 Apr 1998 12:01:07 -0700, Brian Murrell
<brian_murrell@bctel.net> wrote:

>I am trying to convert dates with Time::Local and unfortunately one of the dates I have to deal with is Tue Jan 19 03:14:07 2038 GMT, which you might recognize as the last available second in a 32 bit system.  However the problem seems to be that Time::Local's gmtime function barfs on dates >= January 1, 2038.  The man page hints that this is the limit of a 32 bit integer when that is not quite right.  I've looked into the timegm function to see what is broken, but I am having a hard time figuring out what "cheat" does.  I am not familliar with the algorithm.
>

Did you really mean to set a 400 character line ? ;-}

/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm


------------------------------

Date: Sun, 19 Apr 1998 18:10:57 -0400
From: "Otis Gospodnetic" <otis@POPULUS.net>
Subject: trouble with MLDBM's evals
Message-Id: <6hdt51$58j6@tortola.acunet.net>

Hello,

while trying to retrieve an object stored to a DBM (Berkeley DB) using
MLDBM, I get this error:

MLDBM error: Can't find string terminator "'" anywhere before EOF at (eval
4) line 1.
        while evaluating:
 bless( {'_request' => bless( {'_method' => 'GET','_url' => bless( {'_str'
=> 'http://www.middlebury.edu/usage/Apr-18-1998.pages.html',
'path' => '/usage/Apr-18-1998.pages.html','netloc' =>
'www.middlebury.edu','scheme' => 'http',
'host' => 'www.middlebury.edu'},
'URI::URL::http' )->main::dynamicRequire(),'_content' => '','_headers' =>
bless( {'_header' => {'accept' => ['text/plain'],'user-agent' =>
['UA/0.8'],'from' => ['otis@acunet.net'],
'host' => ['www.middlebury.edu'],'date' => ['Sun, 19 Apr 1998 21:48:29
GMT']}}, 'HTTP::Headers' )->main::dynamicRequire()},
'HTTP::Request' )->main::dynamicRequire(),'_protocol' =>
'HTTP/1.0','_content' => '<HTML>
  27250 - <A HREF="/"> / </A> <BR>
  21605 - <A HREF="/home.jpg"> /home.jpg </A> <BR>
 ....
 ...
at /usr/users/otis/lib/Pauk/DocRepository.pm line 67

Line 67 is:
my ($docID, $webdoc) = each (%repOk);        # %repOk is the HASH tied to a
DBM where my perl objects are stored.

What can I do to 'fix' this problem?
MLDBM's author says, in the BUGS section of MLDBM documentation, that MLDBM
uses lots of evals.  This, as well as a few other similar errors I got from
MLDBM, seem to come from some eval blocks in MLDBM.

Am I just out of luck and should not be using MLDBM or can I get around this
and other similar eval problems somehow?

Thanks!

Otis




------------------------------

Date: 21 Apr 1998 06:42:37 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: UNIX mail script
Message-Id: <6hhf4t$rcm$2@comdyn.comdyn.com.au>

In article <6het21$7u7$1@nnrp1.dejanews.com>,
	anpap@usa.net writes:
> I need a Unix (or perl) cgi script that will enable me to
> send mail without a mail client.

That is impossible. You mean that you don't want to use an external
mail client or so? You will always have to send mail from a mail
client.

> I have tried telneting on port 25 from within a shell cgi
> script, but it didn't work.
> Anyone has a script that works??

use Net::SMTP;

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


------------------------------

Date: Tue, 21 Apr 1998 20:39:44 -0700
From: "scalise" <scalise@dvdo.com>
Subject: Re: unpacking multiple binary shorts (WORDS)
Message-Id: <6hjp49$qcj$1@supernews.com>

Lion

Yes, I think it is doable. Try using
         $x = unpack("H*",$buffer);
I am using something like this for reading a binary file that contains >240K
Bytes, and
it seems to work just fine.

Good luck,

al

Al Scalise
DVDO Inc.
scalise@dvdo.com
----------------------------

Lion wrote in message ...
>I'm writing a binary disassembler for a particular file type I have to deal
>with.
>
>Part of the file contains a long(ish) array (>10,000) of 2-byte WORDS
>specifying simple integer values that I need to get into an array. I'm
>currently seeking to the beginning of the array, reading 2 bytes at a time
>and then unpacking each WORD to an array element:
>
>
>open (IN, $filename) or die "Cannot open file: $!";
>seek (IN, $array_location, 0);
>
>for ($i=0;$i<$array_length;$i++){
>        $byte_count = read (IN, $buffer,$WORD);
>        if($byte_count == 2){
>            $buffer = hex(unpack("H4", $buffer));
>            push (@slurped_data, $buffer);
>        }
>
>e{ 
>            die "Read failed at WORD $i";
>        }
>}
>
>close (IN);
>
>
>This seems slow and heavy to me - there a better way to do it, surely!
>It would be nice to read in the whole length of the array at once and split it up into unpacked 2 byte chunks in a single operation. Is this possible?
>
>TIA
>
>Tony
>*******************************************************************
>Dr. Tony Cox                        
>Jodrell Laboratory                   http:   www.rbgkew.org.uk
>Royal Botanic Gardens                 tel:   (44)-181-332-5360
>Kew, U.K.                             fax:   (44)-181-332-5310
>*******************************************************************
>
>
>
>
>





------------------------------

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 2389
**************************************

home help back first fref pref prev next nref lref last post