[6704] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 329 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 21 05:07:46 1997

Date: Mon, 21 Apr 97 02:00:35 -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           Mon, 21 Apr 1997     Volume: 8 Number: 329

Today's topics:
     ? Can I make a small modal window in browser for output <wwalton@ee.net>
     Re: [Q] How to capitilize beginning of words (Eric Bohlman)
     Again - ? Can I make small modal window <wwalton@ee.net>
     ANNOUNCE: File::Sync 0.05 bug fix release <c.evans@clear.net.nz>
     Re: Combine user_agent types for usage stats program? (Mark Mills)
     Re: Compiling Perl 5.003 on Solaris 2.5.1 (Casper H.S. Dik - Network Security Engineer)
     Re: Get a week number from a file (Steffen Beyer)
     Re: has someone written a word counter (not a wc clone) (Michael Constant)
     Re: Kudos to Tom Christiansen and problems with OO <merlyn@stonehenge.com>
     Re: Leap-year date routine needed (Steffen Beyer)
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th (Cyber Surfer)
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th (Andrew Koenig)
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <garrigue@safran.kurims.kyoto-u.ac.jp>
     Re: List question! (Eric D. Friedman)
     Microsoft and POSIX compliance <tchrist@mox.perl.com>
     Re: Ousterhout and Tcl lost the plot with latest paper (Rainer Joswig)
     Perl as its own metalanguage? (Terrence M. Brannon)
     Please help! <jas@cybernex.net>
     Re: Printing X amount of lines from begining/middle of  <cerlpvk@cestar.technion.ac.il>
     Proposed change to AnyDBM_file <zephyr@wesell.com>
     Re: Puzzle: Count Actual Days from MM,DD,YYY to localti (rga)
     Re: Puzzle: Count Actual Days from MM,DD,YYY to localti (rga)
     Re: Puzzle: Count Actual Days from MM,DD,YYY to localti (Steffen Beyer)
     Re: QUESTION: Class::Template variable access (M.J.T. Guy)
     Re: QUESTION: Class::Template variable access <tchrist@mox.perl.com>
     Re: Scripting vs. Systems <Stefan_Wille@public.uni-hamburg.de>
     Re: Things that work on $_ <merlyn@stonehenge.com>
     Wanted modPerl test site <zephyr@wesell.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 21 Apr 1997 03:16:14 -0400
From: Lynn Walton <wwalton@ee.net>
Subject: ? Can I make a small modal window in browser for output
Message-Id: <335B143E.4DE6@ee.net>

(without using JavaScript?)


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

Date: Mon, 21 Apr 1997 07:53:30 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: [Q] How to capitilize beginning of words
Message-Id: <ebohlmanE8z9x6.FzL@netcom.com>

Mark Mills (mark@ntr.net) wrote:
: On Sat, 19 Apr 1997 01:08:56 GMT, mejohnsn@netcom.com (Matthew
: Johnson) wrote:

: >>It would be nice to see a
: >>:simple code example. 
: >>As any decent FAQ would have.
: rarely are actual code examples needed by programmers, usually they
: are only needed by cut-n-pasters who don't actually understand the
: code and then come back here to bitch that the code didn't work!

Actually, I find code examples quite helpful when learning new (to me) 
features of a language or new APIs.  I do, though approach them only 
after I have at least somewhat of an abstract understanding of the 
concepts involved; the problem with the cut-and-pasters is that they've 
never built such an understanding.  You might want to look at Gerald 
Weinberg's classic _The Psychology of Computer Programming_ for some 
evidence that reading other people's code can make one a better programmer.

All that said, the main problem with putting code examples in FAQs is 
that it would make the documents simply too long.  FAQ documents aren't 
intended to be in-depth tutorials (instead, they should point people to 
such).



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

Date: Mon, 21 Apr 1997 03:24:55 -0400
From: Lynn Walton <wwalton@ee.net>
Subject: Again - ? Can I make small modal window
Message-Id: <335B1647.77F9@ee.net>

Truly sorry folks.  I am having a bad "newsgroup" day.  I somehow bumped
something and sent of the previous message before I could finish it.

Here's the whole post/question.

I just got a part time job doing some web maintaing,designing, etc. I've
seen something I want to do with CGI/perl, on the web, but have skimmed
many books and online sources and haven't found out how. I'm sure it's
easy for someone out there. I'd appreciate a pointer in the right
direction. 

What I want to do is bring up a small modal window in the user's web
browser, when they click on a link to enter a chat room. In it, I want
to prompt for & collect a user name, and a room password. 

I know how to do this with a form. It's the small modal window, that I
don't know how to do. I've seen this done at the following website, and
it seems they are using a perl script (valuser.pl) to do it.  Or is
their perl program probably embedding javascript to make the dialog box?

http://www.booksonline.com/scbc 

When you click the link at the bottom of the page - to "login as
registered member" (or enter guest). 

Thanks for any help given. It will be sincerely appreciated! 

Again, I apologize if this posting has occured more than once.  My ISP's
news server has been screwed up a lot lately, and I didn't think my
first posts got through.

Lynn


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

Date: 20 Apr 1997 13:30:35 GMT
From: Carey Evans <c.evans@clear.net.nz>
Subject: ANNOUNCE: File::Sync 0.05 bug fix release
Message-Id: <5jd5pr$6kp$1@nadine.teleport.com>

I have uploaded version 0.05 of File:Sync to CPAN.  It should appear
at a mirror near you soon, in .../authors/id/CEVANS.  The only change
in this version is the removal of one of the tests that caused
problems on non-Linux machines.

IF YOU HAVE FILE::SYNC 0.04, YOU DO NOT NEED 0.05.

File::Sync provides Perl interfaces to the Unix sync(2) and POSIX.1b
fsync(2) system calls. The fsync() call is needed for putting messages
into qmail maildirs, and sync() is included for completeness.

You will need at least Perl 5.003 to use this module.  5.002 might
work but has not been tested.  You will also need a C compiler for the
XS part of the module.

File::Sync is used by MailFolder's Mail::Folder::Maildir.

-- 
                Carey Evans  <*>  c.evans@clear.net.nz

"Encryption renamed to Encode to avoid US regulation problems"
                     - include/linux/wireless.h in Linux 2.0.30 kernel




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

Date: Sun, 20 Apr 1997 08:44:50 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: Combine user_agent types for usage stats program?
Message-Id: <335ac954.7761168@news.ntr.net>

On Fri, 18 Apr 1997 09:04:35 -0500, "Sped Erstad" <serstad@acc.jc.edu>
wrote:

>In my usage stats program, I am keeping track of the number of users we 
>have based on browser type (user_agent field in Website).  Standard fare. 
> No problem.  Done.
>
>However, I want to combine some of the obvious ones -- for example.  All 
>of the following should be considered the same thing:
>
> Hits -- user_agent
> ----    ---------------------------------------------- 
> 664  -- Mozilla/2.0 (compatible; MSIE 3.01; Windows 95) 
> 467  -- Mozilla/2.0 (compatible; MSIE 3.0; Windows 95) 
> 193  -- Mozilla/2.0 (compatible; MSIE 3.02; Windows 95) 
>
>I would just total them up as MSIE 3.x for Windows 95. 
>
>My question:  Is there a list of these combinations out there that I could
>use?  My results list right now is pretty daunting and non-useful (there's
>over 180 different types of browsers in it right now!) -- I know some of 
>the stats programs must be doing this type of thing, can anyone share some
>code or ideas with me?
>
>Thanks very much.
>
>Shane "Sped" Erstad
>serstad@acc.jc.edu

I don't have a list but I might point out that this is the sort of
task that regexps were born for.



--
Mark <mark@ntr.net>
Please don't sue my boss because you don't 
understand the concept of free speech.


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

Date: 20 Apr 1997 13:23:51 GMT
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Compiling Perl 5.003 on Solaris 2.5.1
Message-Id: <casper.861542832@uk-usenet.uk.sun.com>

jkstill@teleport.com (jared still) writes:


>Can anyone offer some insight on making perl on Solaris 2.5.1?

Yes, don't use GNU binutils.  Remove GNU as, ld etc from your system.
You don't need them.

It's even an old version of GNU as:

>*unknown*: Assembler messages:
>*unknown*:0: Can't open PIC for reading: No such file or directory

>Running Mkbootstrap for Fcntl ()
>chmod 644 Fcntl.bs
>LD_RUN_PATH="" gcc -o ../../lib/auto/Fcntl/Fcntl.so -G -L/lib
>-L/usr/lib Fcntl.o
>/pkgs/gnu/sparc-sun-solaris2.4/bin/ld: invalid number `-R'

And ld complains too, I see.


Use the perfectly good as/ld from /usr/ccs/bin.


BTW, did you remember to reinstall gc after upgrading to 2.5.1?

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


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

Date: 20 Apr 1997 07:50:08 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Get a week number from a file
Message-Id: <5jchrg$95i$1@en1.engelschall.com>


Charles F. Ritter <critter@quack.kfu.com> wrote:
> Steffen Beyer wrote:
> > 
> > Charles F. Ritter <critter@quack.kfu.com> wrote:
> > > But if modules scare you and your on a unix machine you could iterate
> > > over the array returned by the system "cal" command. "cal" returns this:
> >
> > Heavy case of "not invented here"-syndrome? :-)
> > 
> > Or "why use a well-written, well-documented, fast and easy-to-use module
> > if a quick'n'dirty (no offence intended) hack (probably failing at some
> > special case) will do?"-syndrome? :-)

> I don't take this as a flame but as statement of the obvious: if you

Great! Really no flame intended. Just humour (note the smileys).

> have the time and need to learn perl in all of its glory and splendor by
> all means do so. I am. I recall the camel book saying something about
> perl being a glue language... not forcing structure on a problem but
> allowing the programmer to decide where it is needed... TMTOWTDI... I am
> just pointing out a quicky to a perceived problem; without knowing the
> context I leave it to the programmer to decide the appropriatness of the
> solution.

You are surely right about TIMTOWTDI in Perl (for newcomers: That's the
Perl motto and means "There is more than one way to do it"), but given
the way many if not most of the questions in this newsgroup are asked
I doubt that the authors have the competence to judge if there are other
and IMHO better ways to solve their problem than the suggested hack.

So I think one should at least point them to more complete and thorough
solutions as well.

> BTW - since I gave a quicky to the wrong problem might I suggest
> something in the 'open(CAL,"cal $year|")' vein? 8-) humor... just
> humor... no flame required.

Could you explain that joke? I didn't get it.

> Microsoft NT - when they are finally finished it will be the best
> documented unix operating system on the market.

I see you like jokes... :-)

Actually, since Windows NT is claimed by Microsoft to be POSIX-compliant,
Microsoft has got the official right to call it "UNIX".

That's a bad joke, I know, but it is true! (Was in the newspapers somewhere)

Yours,
-- 
    |s  |d &|m  |    Steffen Beyer <sb@sdm.de> (+49 89) 63812-244 fax -150
    |   |   |   |    software design & management GmbH & Co. KG
    |   |   |   |    Thomas-Dehler-Str. 27, 81737 Munich, Germany.
                     "There is enough for the need of everyone in this world,
                     but not for the greed of everyone." - Mahatma Gandhi


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

Date: 21 Apr 1997 00:45:50 -0700
From: mconst@soda.CSUA.Berkeley.EDU (Michael Constant)
Subject: Re: has someone written a word counter (not a wc clone)
Message-Id: <5jf5ve$kqk@soda.CSUA.Berkeley.EDU>

Eli the Bearded  <usenet-tag@qz.little-neck.ny.us> wrote:
>I figure I could put to good use a program/procedure that would tell me
>the X most frequently used words in a file and the number of appearances
>of each. Has someone written such a thing? (Preferably with lots of
>nice features like exclusion lists and sanity checks on words so the
>odd uuencoded file will produce an error message not garbage counts.)

    perl -0pe 's/\W+/\n/g' | sort | uniq -c | sort -nr | head -20

That will give you a list of the 20 most frequently used words, along
with the number of occurences of each.  A powerful and efficient
exclusion list engine is implemented by adding a grep -v before the
first sort.  If you want the matches to be case insensitive, add
"$_ = lc;" to the front of the perl expression.

The code above treats any sequence of letters and underscores as a word;
you may want to refine this by, for example, allowing words to contain
apostrophes between letters.  (Don't allow apostrophes to count as word
characters anywhere, or single quotes will mess you up.)
-- 
        Michael Constant (mconst@soda.csua.berkeley.edu)


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

Date: 20 Apr 1997 05:32:59 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: ljnelson@unix.amherst.edu
Subject: Re: Kudos to Tom Christiansen and problems with OO
Message-Id: <8civ1h6fic.fsf@gadget.cscaper.com>

>>>>> "Laird" == Laird Nelson <lnelson@wombat.eng.netsinc.com> writes:

Laird> brannon@bufo.usc.edu (Terrence M. Brannon) writes:
>> nelson <nmljn@wombat.netsinc.com> writes:
>> > Any other jazz pianist Perl types out there besides myself?
>> The only Perl types are scalar, array, and hash. :-)

Laird> Which is why I practice my major scalars every day.

But do you play Lis(z)t?

Laird> {FX: ducks}

"Quack quack quack"? :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 499 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
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@ora.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: 20 Apr 1997 07:15:24 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Leap-year date routine needed
Message-Id: <5jcfqc$64u$2@en1.engelschall.com>

[mailed && posted]

R D Davis <rdd@access2.digex.net> writes:

> Does anyone know where I can find a Perl script which can be used to
> determine which years are leap-years?  I need to write a script which
> determines if the present day is the last day of the month; hence, the
> script would be much more accurate with leap-years taken into
> consideration.

This can be done simpler still:

use Date::DateCalc qw(days_in_month);
use Date::DateCalcLib qw(parse_date);

($yy,$mm,$dd) = parse_date(`/bin/date`);

if ($dd == days_in_month($yy,$mm))
{                             # today is the last day of the current month:
}
else
{                             # today is NOT the last day of the current month:
}

Hope this helps.

Yours,
-- 
    |s  |d &|m  |    Steffen Beyer <sb@sdm.de> (+49 89) 63812-244 fax -150
    |   |   |   |    software design & management GmbH & Co. KG
    |   |   |   |    Thomas-Dehler-Str. 27, 81737 Munich, Germany.
                     "There is enough for the need of everyone in this world,
                     but not for the greed of everyone." - Mahatma Gandhi


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

Date: Sun, 20 Apr 1997 14:12:15 +0100
From: cyber_surfer@gubbish.wildcard.demon.co.uk (Cyber Surfer)
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <MPG.dc3e037a80f4de4989782@news.demon.co.uk>


With a mighty <nagleE8x5Gz.9KL@netcom.com>,
nagle@netcom.com uttered these wise words...

>     Visual Basic has been quite successful; it's supplanting COBOL in
> the client side of business systems.  A sizable commercial market exists in
> objects for Visual Basic, one of the few object-oriented systems for
> which that has happened.  It's not widely used in academia,
> but in the real world, things are different.  Don't laugh at VB4;
> this is not your father's Dartmouth BASIC.  It's a decent language now.

This is a point that I've been making, for a while now. VB and C++ 
compliment each other in just the way that JO claims is true for Tcl 
and Java, one for the "scripting" level, the other for "system" level.
The latest version of VB is 5.0 (yep, it's available: I've seen a non-
beta copy, tho it was still in its box at the time). It's a very 
serious grown-up Basic.

Sadly, there are people who'll slag off VB. The criticisms that I've 
seen have reminded me of the myths surrounding Lisp. When I see a VC++ 
programmer distorting the true capabilities of VB (downward, of 
course), the techniques they use appear to be _exactly_ the same. 
Perhaps they even share the same motivation? I don't know.

I'm not a VB programmer. I'm not sure I'd even call myself a C++ 
programmer, for various reasons. However, I don't feel any need to 
misrepresent VB's capabilities. If VB can do much of what I do in C++, 
then I'm overjoyed, as it may mean that I can use something else, like 
Java (or perhaps someday, my preference, Lisp) while a VB programmer 
writes that boring DLL etc.

Could it be that some C++ programmers feel threatened by VB? I find it 
ironic that a posting that's critical of VB might also slag off 
Delphi, which is a language far closer to C++, and yet still very easy 
to use. Therefore more threatening to a C++ programmer who doesn't 
like Pascal?

Again, I don't know, as I've never felt a bias so strongly that I had 
to distort the truth. I freely admit that I'm no fan of C/C++, but I 
also admit that these languages have some utility. I don't let that 
cloud my judgement by refusing to see the strengths of VB, Delphi, and 
even a few languages (and implementations) of a more esoteric nature.

Go figure.
-- 
<URL:http://www.wildcard.demon.co.uk/> You can never browse enough
  Martin Rodgers | Programmer and Information Broker | London, UK
            Please note: my email address is gubbish.


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

Date: Sun, 20 Apr 1997 14:16:37 GMT
From: ark@research.att.com (Andrew Koenig)
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <E8xwzp.8tJ@research.att.com>

In article <MPG.dc3e037a80f4de4989782@news.demon.co.uk> cyber_surfer@gubbish.wildcard.demon.co.uk (Cyber Surfer) writes:

> Sadly, there are people who'll slag off VB.

For all X, there are people who will slag off X.

> Could it be that some C++ programmers feel threatened by VB?

For all Y and X, there are Y programmers who feel threatened by X.
That might be part of the reason that people slag off X for all X.
-- 
				--Andrew Koenig
				  ark@research.att.com
				  http://www.research.att.com/info/ark


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

Date: 21 Apr 1997 12:17:39 +0900
From: Jacques GARRIGUE <garrigue@safran.kurims.kyoto-u.ac.jp>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <l2lo6d9i98.fsf@safran.kurims.kyoto-u.ac.jp>

ouster@tcl.eng.sun.com (John Ousterhout) writes:

> One of the most common criticisms of my white paper has been that the
> distinction between scripting and system programming is artificial, and
> that it is possible for a single language to be good at both tasks.
> Lisp-like languages such as Scheme were suggested as living proof.  I
> can't prove that it's impossible for a single language to be good at
> both scripting and system programming, but I don't know of a good example
> and I doubt that it will ever happen.  The reason for this is the
> difference in typing, as I explained in the white paper. A given language
> embodies a particular style of typing, which can range from very strongly
> typed to totally untyped.  Once that decision has been made, the language's
> position on the spectrum between system programming and scripting is set.
> I think it's possible to have a language that's in the middle, but it's
> not likely to be terrific at either task.
> 
> Let's take Lisp as an example.  [..]

Since Lisp is dynamically typed, according to your hierarchy of
typing, it is in the middle between TCL and C. It is then easy to make 
your point.

But you have completely ignored here another thread of comments: there 
exist now typing systems that both are stronger than C, and give you
(almost) as much programming freedom as Lisp.

Typically, when one speaks of "strongly typed" languages, this is
talking about strongly typed functional languages, like ML or
Haskell. Strong here means both that the constraint is stronger --you
do not use cast in these languages, meaning types give you absolute
security--, and that the expressive power is strong --otherwise you
won't be able to write in such languages.

There was an example a while ago in TkGofer: did you realize that it
was _strongly typed_. You can express things with the same concision
as TCL, and be more strictly typed than JAVA !

I do not contest the expressive power of TCL (as a scripting
language), and even think that it's syntax to use the Tk library is
very nice. That is why we intended to stay as close to TCL as possible
in the LablTk library. This library is built on Objective Label, a
derivative of Objective Caml, in the ML family.

Let's see a small example:

(TCL)
button .b -text Hello -font {Times 12} -relief sunken

(LablTk)
let b = Button.create parent:top text:"Hello" font:"Times 12" relief:`Sunken

Again, the syntax is not more difficult. Allegedly a little bit more
verbose, but not really bothering. The difference is that everything
that can be checked is checked at compile time (or even before, using
the interactive editor):

* that Button has text, font, and relief configuration option
* that sunken is a valid relief

In order to do this, we had to extend ML's type system, which is
already powerful, in two ways: labeled and optional arguments, and
polymorphic variants (the `Sunken). But this was possible, keeping all 
the nice properties.

So, how such a language compares to Tcl. The essential difference is
that you can write and manage big applications in it, and do not need
to use a specific scripting language for the GUI. One could even think 
of allowing scripting and extensions in the language itself (dynamic
loading is already available).

Speed also: very fast bytecode compilation should give you code
already orders faster. And you can also use a native code compiler to
compete with C.

OK, what's my point. Not that this language is the solution to all
problems. But that in the future languages and type systems of this
kind will undergo huge progresses, and eventually make irrelevant your
distinction between system and scripting languages --at least for
applications.  Let's call them "strongly typed" languages (that's
what they are called now).

Will C then disappear ? I do not believe so. I think that we should
rather use a 3-level classification, if we want to follow your view.

* Low-level, system programming languages, for really computation
intensive or very low level tasks: C, C++ (I don't believe JAVA fits
in here)

* Application development languages: C++, JAVA, "strongly typed"
languages, and many other

* Script languages: Tcl, Guile..., "strongly typed" languages

I do not know the end of the story, but since low level tasks will be
more and more delegated to drivers and libraries, I think the ability
to handle the last two kinds of programming in a uniform framework is
an important one.

---------------------------------------------------------------------------
Jacques Garrigue	Kyoto University      garrigue@kurims.kyoto-u.ac.jp
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>


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

Date: 21 Apr 1997 06:32:46 GMT
From: friedman@medusa.acs.uci.edu (Eric D. Friedman)
Subject: Re: List question!
Message-Id: <5jf1me$l49@news.service.uci.edu>

[mailed, posted]

In article <5jerc4$3hh@server.cs.vt.edu>,
Mir Farooq Ali <mfali@cs.vt.edu> wrote:
>Hello! If I've got a list called something like @list. I want to read
>line by line a large amount of data. Then I want to add one particular
>field from each of the lines, call it $field, to this list. I want only
>unique elements to be added to the list. This means that once the loop
>ends, the @list should consist of only unique elements. 

use a hash and store your fields in its keys.

my %hash =();
while <FH>
{
  my ($field,$not_wanted,$also_notwanted) = split(/:/,$_);
  $hash{$field} = '';
}
 
my @unique_elements = keys %hash;

>Any help will be appreciated. Please reply directly by email since I do
>not visit this newsgroup often.

Bzzt!  If you've got time to post, you've got time to read.
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: 20 Apr 1997 15:27:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Microsoft and POSIX compliance
Message-Id: <5jdcls$b04$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, sb@en.muc.de writes:
:Actually, since Windows NT is claimed by Microsoft to be POSIX-compliant,
:Microsoft has got the official right to call it "UNIX".

No programmer takes that claim seriously, because they realize that it is
of no practical use whatsoever.  This alleged POSIX compliance does not
appear to have been a good-faith effort to ease porting and integration
of POSIX-based applications.   Or if it was such, then it in fact failed
miserably at those goals, which are the only ones that programmers
care about.  In a business, marketroids, salespukes, and lawyers have
different goals from those who actually do work and produce something.
Usually, is is the former who triumph over the latter, due to the simple
rule that those who print the money make the rules.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    X-Windows: It could be worse, but it'll take time.
	--Jamie Zawinski


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

Date: Sun, 20 Apr 1997 16:52:32 +0200
From: joswig@lavielle.com (Rainer Joswig)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <joswig-ya023180002004971652320001@news.lavielle.com>

In article <3070521785789755@naggum.no>, Erik Naggum <erik@naggum.no> wrote:

> * Paul Wilson
> | You could build a language based on Lisp/Scheme technology with a more
> | conventional syntax, and more redundant keywords.
> 
> * Fergus Henderson
> | Sure, you could, but has anyone done it?
> 
> yes.  it's called DYLAN, for DYnamic LANguage.  see comp.lang.dylan.

NewtonScript, Sk8Script, AppleScript, ...

All from Apple.

-- 
http://www.lavielle.com/~joswig/


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

Date: 20 Apr 1997 05:45:48 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: Perl as its own metalanguage?
Message-Id: <ysiz4td1uakm.fsf@bufo.usc.edu>


I was going through a book on Prolog and realized that all the
features of Prolog that the author described which make it a
metalanguage for itself also apply to Perl:
	* a program can create new goals by computation and 
	then execute them.

	* a program can examine itself and modify itself

	* by declaring operators, a program can even change the
	syntax of the language itself (not sure on this one)

	* Prolog programs can extend and modify the inference
	engine that controls program execution. Perl can create
	any number of control structures via redo, last, next

	* As a sidenote he says: Prolog blurs the distinction
	between program and data. 
	

-- 
o============o  Sending  unsolicited commercial e-mail (UCE) to this address
 Legal Notice   is indication of your consent to pay me $120/hour for 1 hour
o============o  minimum for professional proofreading & technical assessment.
terrence brannon * brannon@kappa.usc.edu * http://rana.usc.edu:8376/~brannon


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

Date: Sun, 20 Apr 1997 15:26:04 GMT
From: "Joan A. Steinbock" <jas@cybernex.net>
Subject: Please help!
Message-Id: <E8y0Cz.8KC@nonexistent.com>

I am in very serious need of International sites from...Europe...
Germany, France, Belgium, as is life many of our collegues have..
moved on...they have not retained their sites...I believe
JAS'S has been a good resources....and I think many of you have as
well...I cannot search the web for all your sites so I ask you to 
submit your sites to me....using this forum is one way:)
Please visit http://www.ios.com/~jas/
JAS'S International Javscripts ...if you wish to e-mail your site
to me e-mail jas@cybernex.net...
Lets keep this thing rockin...
regards JOAN
and btw don't forget to visit Mr. Woolridge Javascript Index new site
it is featured as a main link this month....seeyall
-- 
-- 
"I swear MOM It's only a hobby"
___________________________________________________________
Joan A. Steinbock
jas@cybernex.net
http://www.ios.com/~jas/
http://www.ios.com/~jas/psych.htm
This tagline is GOINGNOWARE To register, send me $10
                                                      
            __o
          _ \< _
         (_)/ (_)
___________________________________________________________


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

Date: 20 Apr 1997 12:55:38 GMT
From: cerlpvk <cerlpvk@cestar.technion.ac.il>
Subject: Re: Printing X amount of lines from begining/middle of file. How?
Message-Id: <5jd3oa$7ei@news.huji.ac.il>

sed '15,d$' filename



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

Date: 20 Apr 1997 14:49:06 GMT
From: "john z." <zephyr@wesell.com>
Subject: Proposed change to AnyDBM_file
Message-Id: <01bc4d8f$bfa5afa0$01d4b7cc@pciii>

it would have been more usefull if AnyDBM did a return $mod instead
of return 1. the user at least has a clue as to which set of files are
available
and can be use'd.



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

Date: Sun, 20 Apr 1997 12:33:39 GMT
From: rga@io.com (rga)
Subject: Re: Puzzle: Count Actual Days from MM,DD,YYY to localtime(time) - REQ: Easier Way
Message-Id: <335a0c92.6787178@news.io.com>



Thanks !

I put some work into a perl translation, but
don't know C,  and I think I'm missing something
here ... getting pretty invalid numbers as results.

Anyone want to convert it ?

>====================================================================
>mon = (mon+9)%12;
>if(mon>=10)
>	year = year - 1;
>pjul = (int)(year*365.25) + (int)(mon*30.6+0.5) + (day-1);
>printf("%d\n",pjul);
>
>====================================================================




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

Date: Sun, 20 Apr 1997 12:30:32 GMT
From: rga@io.com (rga)
Subject: Re: Puzzle: Count Actual Days from MM,DD,YYY to localtime(time) - REQ: Easier Way
Message-Id: <335a0bc6.6583131@news.io.com>

Nathan Torkington <gnat@elara.frii.com> wrote:

>The "time" entry in the perlfunc(1) manpage and the manpage for the
>Time::Local module (part of the standard Perl distribution) should
>help you understand how it works.  If you don't know what % does, look
>it up in the perlop(1) manpage.
                    

Hmmm ... I'm missing something here.
Please, bear with me, and thanks for your
help so far ...  BUT ...

I see this stops working for dates
preceeding 1/1/1970 ?




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

Date: 20 Apr 1997 07:31:04 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Puzzle: Count Actual Days from MM,DD,YYY to localtime(time) - REQ: Easier Way
Message-Id: <5jcgno$885$1@en1.engelschall.com>

[mailed && posted]

> rga@io.com (rga) writes:

> >   Does  (localtime(time))[5]  reset to "1" next year ?
> >   or does it set to "100"  ?
> > 
> > 	Do I need to do something like this:
> > 
> > # define year by century 
> > if ($year > 95) {$year = "19$year";}
> > elsif ($year < 10) {$year = "200$year";}
> > else {$year = "20$year";}

Nathan Torkington <gnat@elara.frii.com> wrote:

> #!/usr/bin/perl -w

> use Time::Local;        # part of the standard perl5 distribution

> @ARGV == 3 or die "usage: daystonow day month year\n";

> ($day, $month, $year) = @ARGV;
> $then = timelocal(0,0,0, $day, $month-1, $year-1900);
> $now = time;

> # calculate hours, minutes, seconds and days
> $difference = $now - $then;
> $seconds = $difference % 60;
> $difference = ($difference - $seconds)/60;
> $minutes = $difference % 60;
> $difference = ($difference - $minutes)/60;
> $hours   = $difference % 24;
> $difference = ($difference - $hours)/24;
> $days    = $difference;

> print "There have been $days days between $day/$month/$year and now.\n"

Why so complicated?

Get the module "Date::DateCalc" from CPAN or from
http://www.engelschall.com/u/sb/download
and write the following:

"days_to_now":
-------------------- cut here -------------------- cut here --------------------
#!/usr/bin/perl -w

use Date::DateCalc qw(dates_difference);
use Date::DateCalcLib qw(parse_date);

@ARGV == 3 or die "usage: days_to_now day month year\n";

($day, $month, $year) = @ARGV;

($yy,$mm,$dd) = parse_date(`/bin/date`);
# or whatever your preferred method is for this

$days = dates_difference($year,$month,$day,$yy,$mm,$dd);

print "There have been $days days between $day/$month/$year and now.\n"

-------------------- cut here -------------------- cut here --------------------

This also works for years beyond 1999.

And this has the additional advantage that any subsequent date calculations
are also a snap. :-)

Hope this helps.

Yours,
-- 
    |s  |d &|m  |    Steffen Beyer <sb@sdm.de> (+49 89) 63812-244 fax -150
    |   |   |   |    software design & management GmbH & Co. KG
    |   |   |   |    Thomas-Dehler-Str. 27, 81737 Munich, Germany.
                     "There is enough for the need of everyone in this world,
                     but not for the greed of everyone." - Mahatma Gandhi


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

Date: 20 Apr 1997 15:07:00 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: QUESTION: Class::Template variable access
Message-Id: <5jdbek$87m@lyra.csx.cam.ac.uk>

Tom Christiansen  <tchrist@mox.perl.com> wrote:
>    brannon@bufo.usc.edu (Terrence M. Brannon) writes:
>:a> print $u->$index;
>
>Put parens there:
>
>    print $u->$index();

It'd be nice to know _why_ those brackets are needed.   It's not as if
there's any ambiguity about.


Mike Guy


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

Date: 20 Apr 1997 15:21:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: QUESTION: Class::Template variable access
Message-Id: <5jdca5$b04$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:
:>Put parens there:
:>    print $u->$index();
:It'd be nice to know _why_ those brackets are needed.   It's not as if
:there's any ambiguity about.

I see no brackets there.   If I'd wanted brackets, I'd've written:

    print $u->$index[];

just as if I'd wanted brace I'd've used

    print $u->$index{};

The reason that *parentheses* are need is quite simply because the yacc
grammar says so.  You might want to try "fixing" this and see what
happens to the shift/reduce conflicts.  (No, I don't know quite what
it does; just a hunch.)

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


I am a little more weird today than normal.  --Andrew Hume


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

Date: Sun, 20 Apr 1997 16:50:17 +0200
From: Stefan Wille <Stefan_Wille@public.uni-hamburg.de>
Subject: Re: Scripting vs. Systems
Message-Id: <335A2D29.35FA122B@public.uni-hamburg.de>

Hello Marc
 
> > This is why Lisp doesn't have a type system,
> 
> Common Lisp does have an expressive type system (and good implementations
> use this plus considerable type inference both for optimization and for type
> checking). What it doesn't have is _enforced_ statically decidable typing.
> 
> -- Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>


Your answer makes me interested in learning more on type systems 
that do not enforce statically decidable typing.

Could You (or someone else) please point out some good books that
cover this topic? 

Thank you very much

Stefan


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

Date: 20 Apr 1997 05:59:54 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: searlea@aston.ac.uk (ash)
Subject: Re: Things that work on $_
Message-Id: <8cd8rp6e9h.fsf@gadget.cscaper.com>

>>>>> "ash" == ash  <searlea@aston.ac.uk> writes:

ash> How many functions will operate on $_ or @_ as the default
ash> if no other variables/arrays are specified?  All?

Many work on $_, but some don't (like chdir(), which takes you to your
home directory).  shift (inside a subroutine) is the only one that
uses @_ by default (not counting the deprecated scalar-split).

ash> Is there a list anywhere?

The perlfunc(1) manpage should clearly show any default args.  If not,
"perlbug" it.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 499 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
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@ora.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: 20 Apr 1997 14:42:41 GMT
From: "john z." <zephyr@wesell.com>
Subject: Wanted modPerl test site
Message-Id: <01bc4d8e$da3914c0$01d4b7cc@pciii>

im looking for a virtual server site that has modPerl and keeps current on
perl.
tks.
john z.
zephyr@wesell.com



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

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

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