[10211] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3804 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 23 17:07:20 1998

Date: Wed, 23 Sep 98 14:00:19 -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, 23 Sep 1998     Volume: 8 Number: 3804

Today's topics:
        [Q:] read/write binary with half-byte length(a nibble) phu@mobility.com
    Re: Hashes springing into existence [Was: more regex/pa <dgris@rand.dimensional.com>
        Help! How to run a UNIX process in background (Chakravarthy KM Nalamotu)
        How to tinker with @_ in threaded Perl? (Mark-Jason Dominus)
    Re: MLDBM object methods <jdporter@min.net>
    Re: MLDBM object methods (Steve Manes)
        mod_perl woes (Ryan McGuigan)
    Re: mod_perl woes (brian d foy)
    Re: Need help with packages (Sean McAfee)
    Re: Perl & Java - differences and uses (Paul David Fardy)
    Re: Perl & Java - differences and uses <jdporter@min.net>
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl & Java - differences and uses <uri@camel.fastserv.com>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <jdporter@min.net>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <jdporter@min.net>
    Re: Poll: How Did You Learn Perl? <pholser@americasm01.nt.com>
    Re: Poll: How Did You Learn Perl? (Nathan V. Patwardhan)
    Re: Poll: How Did You Learn Perl? <merlyn@stonehenge.com>
    Re: Poll: How Did You Learn Perl? <jeff@vpservices.com>
    Re: Poll: How Did You Learn Perl? (Craig Berry)
    Re: Poll: How Did You Learn Perl? (Brand Hilton)
    Re: question about variable interpolation in search pat (Ilya Zakharevich)
        Running CGI Perl scripts on NT Netscape Enterprise 3.01 <library@byu.edu>
        send geroge reese (was Re: Call for Participation: Pyth <uri@camel.fastserv.com>
        sock the heck out of port 23 <samblack@earthlink.net>
    Re: unlink() not working in NT!!?? (Tye McQueen)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 23 Sep 1998 20:35:20 GMT
From: phu@mobility.com
Subject: [Q:] read/write binary with half-byte length(a nibble)
Message-Id: <6ubm28$6sg$1@nnrp1.dejanews.com>

hi, all

I was trying to read a large binary file, modify a few fields and write it
back. The problem is some of the fields have only 4-bit length and others
have, say,  12-bit length. I'v played unpack for a while and searched the
archive but still can not find a suitable solution. For example, I have a
2-byte string like this:  "0011000000000001" the  first 4-bit is one number,
the rest 12-bit is another, so in this case I should get "3" for first and
"1" for the second one. I know I need to do something like

>> or << to deal with this but  is there any sysmetic way I can do this ? (For each
data field I know the start bit and bit length.)

Any help is very much appreciated !

Thanks,

-Peter

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 23 Sep 1998 20:56:20 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Hashes springing into existence [Was: more regex/pattern substitution]
Message-Id: <6ubmas$ak9$1@rand.dimensional.com>

[posted to comp.lang.perl.misc and mailed to the cited author]

In article <6ubh85$iks$1@mathserv.mps.ohio-state.edu>
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:

>*Before* newHV() is called, somebody checked that it need to be
>called, right?  How do you think it did it, consulting the spirit of
>Disraeli?  ;-)

What?  Do you mean that perl doesn't consult with spirits?  Damn. :-)

Actually, I thought that hv_fetch() was called and that if it
failed newHV() would be called without ever involving any
of the *exists functions.  I must have been mistaken, though,
as I can no longer find the code that I thought did that.

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the 
ending, but it still kind of surprised me.'
      David Hatunen, talking about the movie Titanic


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

Date: 23 Sep 1998 20:10:31 GMT
From: kittu@Hawaii.Edu (Chakravarthy KM Nalamotu)
Subject: Help! How to run a UNIX process in background
Message-Id: <6ubkjn$ril@news.Hawaii.Edu>

Hello Perl Users,
How can I run a UNIX command in the background from a perl script. 
I had no problem doing the same from a korn script.
I tried the following two, they do not seem to be working.

------------
`compress < compress.pipe > split.pipe &`;
------------
`compress < compress.pipe > split.pipe \&`;
------------

I appreciate your responses.

Thanx,
  Kittu.



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

Date: 23 Sep 1998 19:51:37 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: How to tinker with @_ in threaded Perl?
Message-Id: <6ubjg9$8nn$1@picasso.op.net>

I have a program which, for various reasons, contains the following
code:

	sub wrapper { unshift @_, qq{$cref}; goto &_handler }

	sub _handler {
	  my $cref = shift;
	  ...
	}

This works fine on many systems, but recently I have been getting
failure reports.  My hypothesis is that under threaded Perl, @_ is
lexical, so the effect of the `unshift' is confined to `wrapper', and
_handler never gets the extra $cref argument.

I imagine there would be a similar problem with an AUTOLOAD function
that wanted to modify the function arguments before calling the real
function.

How can I work around this?
-- 

mjd@pobox.com                                             Mark-Jason Dominus
mjd@plover.com                              Plover Systems, Philadelphia, PA


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

Date: Wed, 23 Sep 1998 16:05:37 -0400
From: John Porter <jdporter@min.net>
Subject: Re: MLDBM object methods
Message-Id: <36095491.A4CFAF99@min.net>

Steve Manes wrote:
> 
> John Porter <jdporter@min.net> wrote:
> >
> >  $dbm = tie %o, 'MLDBM', ...;
> >  $key = tied($dbm)->FIRSTKEY;

> $O = tie %Msg, 'MLDBM', "/tmp/msg.dat", O_RDWR|O_CREAT, 0664;
> my $key = tied($O)->FIRSTKEY;

I realized that I had it wrong, and it looks like you did too,
in at least some places.  It should be like this:

  $obj = tie %hash, ...

  $obj->FIRSTKEY;
  tied(%hash)->FIRSTKEY;

IOW, tied(%hash) returns the same ref that the tie did.

-- 
John "Many Jars" Porter


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

Date: Wed, 23 Sep 1998 20:55:50 GMT
From: smanes@NOSPAM.HEREmagpie.com (Steve Manes)
Subject: Re: MLDBM object methods
Message-Id: <36095afa.1013024532@news.panix.com>

On Wed, 23 Sep 1998 16:05:37 -0400, John Porter <jdporter@min.net>
wrote:
>I realized that I had it wrong, and it looks like you did too,
>in at least some places.  It should be like this:
>
>  $obj = tie %hash, ...
>
>  $obj->FIRSTKEY;
>  tied(%hash)->FIRSTKEY;

I know.  I figured it out about an hour ago... (doh!)

Unfortunately, those methods didn't function as I expected they would,
i.e. like their dbm counterparts.  They seem to traverse the physical
hash rather than the table in a logically sequential way, i.e. in a
hash of $Msg{0}.. $Msg{9} this won't work:

	for ($key = (tied %Msg)->FIRSTKEY;
	      $key < 26;
	      $key = (tied %Msg)->NEXTKEY($key)) {
		print $key;	## print 0 -> 9, sequentially
	}

Instead, FIRSTKEY returns 21 and subsquent calls to NEXTKEY return a
quarterback snap call: 6, 19, 15, 4, etc.

Do you know how to get around this?  I know I can get an ordered list
of keys with sort(keys %Msg) but that means hauling a potentially huge
array into memory.  But it also means that I can't arbitrarily set
$key to, say, 6789, call NEXTKEY and expect 6790 (or 9 zillion, if
there were lots of empty records in between).

------------------[ http://www.magpie.com ]-----------=o&>o-------
Steve Manes        smanes [at] magpie.com       N'Yawk, N'Yawk


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

Date: Wed, 23 Sep 1998 20:13:14 GMT
From: ryan@mail.ramresearch.com (Ryan McGuigan)
Subject: mod_perl woes
Message-Id: <uDcO1.103$Fl6.1773475@news.abs.net>

Ok, I struggled to get the latest versions of Apache and mod_perl to
compile correctly, the readmes with apache did not help at all.  Anyway, I
finally got the thing to work.  After getting it setup with our old
configuration, I enabled it to execute our whole cgi dir with mod_perl,
and it worked, sort of.  It's very weird, it'll work for a while,
sometimes doing weird things, and then it'll just crap out.  

For example, I've been working on a message board program, it displays
different things depending on the post or Query string input.  Without any
input it just displays the threads posted to the board.  When run through
mod_perl, it will SOMETIMES run as though it's received some kind of
input, even though it hasn't.  Any thoughts?  I've never used mod_perl
before, so any advice is appreciated.

thanks,
Ryan


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

Date: Wed, 23 Sep 1998 16:46:02 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: mod_perl woes
Message-Id: <comdog-ya02408000R2309981646020001@news.panix.com>
Keywords: from just another new york perl hacker

In article <uDcO1.103$Fl6.1773475@news.abs.net>, ryan@mail.ramresearch.com (Ryan McGuigan) posted:

>For example, I've been working on a message board program, it displays
>different things depending on the post or Query string input.  Without any
>input it just displays the threads posted to the board.  When run through
>mod_perl, it will SOMETIMES run as though it's received some kind of
>input, even though it hasn't.  Any thoughts?  I've never used mod_perl
>before, so any advice is appreciated.

mod_perl involves persistent processes, so if one doesn't clean up 
after oneself, have poor programming style, or lightly use global
variables, one can easily get bitten.

be sure to read all of the docs installed by mod-perl as well as the
stuff at <URL:http://perl.apache.org>.

good luck. :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Wed, 23 Sep 1998 20:31:15 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Need help with packages
Message-Id: <nUcO1.4404$F7.16450184@news.itd.umich.edu>

In article <360948EB.D2ABF839@ichips.intel.com>,
Jim Vaught  <jvaught@ichips.intel.com> wrote:
>I am having a scoping problem that I thought I could solve with
>packages, but I can't
>quite get it to work.
[snip]

>Here is a
>simple example:

>package Setup;
>sub make_var {$new_var = 7;}
>
>package Script;
>$new_var = 13;
>&Setup::make_var;
>
>print "Finished with Setup:: <$Setup::new_var>, ";
>print "Script:: <$Script::new_var>\n";

>This gives:
>Finished with Setup:: <7>, Script:: <13>

>What I would like is:
>Finished with Setup::<>, Script::<7>

Try replacing your &Setup::make_var line with this:

{
	local *Setup::new_var = \$Script::new_var;
	&Setup::make_var;
}

>Is there any way with Perl that I can specify that I want a function to
>behave as if
>it belonged to (was declared in) the current package instead of the
>package it really was
>declared in.  By that I mean is there a way to have the default package
>for the variables
>accessed in a function be determined dynamically (by the package of the
>caller) rather than statically (by the current package at compile time).

Yes, but only by temporarily replacing the function's package's entire
symbol table with the calling package's table before calling the function.
This would be very dangerous, not to mention time-consuming.  Far better to
localize the variables you know will be changed by the function, as I've
done above.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: 23 Sep 1998 19:31:26 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ubiae$dki$1@coranto.ucs.mun.ca>

John Porter <jdporter@min.net> wrote:
> So we (some of us) are still waiting for the proof that 
> all Americans speak French.  Maybe you could cite some Bureau of
> Census statistics.

George Reese <borg@imaginary.com> writes:
> No, this is not the case at all.  Only one person has actually
> challenged any of my premises.  And that appears to be the only
> constructive line of discussion going on in this thread.

"Let no one tell me that silence gives consent, because whoever
 is silent dissents." -- Maria Isabel Barreno 

Many of us have chosen not to openly question your rationale because
we privately question you're rational.

Paul Fardy


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

Date: Wed, 23 Sep 1998 16:21:13 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <36095839.1B1AA76F@min.net>

George Reese wrote:
> 

> :> :> For those things where taking an OO approach will not work, perl,
> :> :> python, and java are all bad solutions.
> :>
> :> : Which is to say, in the problem domain in which perl, python, and
> :> : java are not bad solutions, OO is the best approach.
> :> : Again, close enough to "OO is Everything" as makes no difference.
> :> : (Yes, let's ignore embedded real-time systems.  Fair enough?)
> :>
> :> If you say "ignore everything in which OO is not a good solution",
> :> yes, my response will be "OO is everything".
> 
> : What I find interesting is that this clearly betrays that you
> : think all non-[embedded/real-time/etc] domains are inherently
> : best approached with OO.  That is the claim about which I am
> : skeptical.
> 
> Because I say that real-time systems are not well suited to OO
> programming, that does not imply ANYTHING about my thoughts on other
> realms.

That is true, taken in isolation.  But there is more.

IMHO (:-) your statements, which I have quoted above, show that
you equate the non-[embedded/real-time/etc] realm with the realm
of problems best handled by OO.

Put another way, you seem to equate the domain where OO is a *good*
solution with that where OO is the *best* solution.  So, OO is 
either the best solution for the job, or it isn't even a contender 
(as with real-time, embedded...).


> : Hmm. Care to comment on Smalltalk specifically?
> 
> What about it?  I can write one class and build an entire application
> from methods in that class by calling those methods procedurally.
> 
> No behaviour, no objects.  There is nothing a language can do to
> enforce that.

Thank you for your comments.


-- 
John "Many Jars" Porter


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

Date: Wed, 23 Sep 1998 20:32:00 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <4VcO1.1625$Ge.5371636@ptah.visi.com>

In comp.lang.java.programmer Paul David Fardy <pdf@morgan.ucs.mun.ca> wrote:
: John Porter <jdporter@min.net> wrote:
:> So we (some of us) are still waiting for the proof that 
:> all Americans speak French.  Maybe you could cite some Bureau of
:> Census statistics.

: George Reese <borg@imaginary.com> writes:
:> No, this is not the case at all.  Only one person has actually
:> challenged any of my premises.  And that appears to be the only
:> constructive line of discussion going on in this thread.

: "Let no one tell me that silence gives consent, because whoever
:  is silent dissents." -- Maria Isabel Barreno 

: Many of us have chosen not to openly question your rationale because
: we privately question you're rational.

You are an idiot.  I did not imply I was right or that everyone agreed
with me because simply because one person has stated their
disagreement with specific premises.  I stated directly that only one
person has bothered to take the time and that everyone else in this
thread has chosen to assign beliefs to me I do not hold or to attack
me personally.  Thanks for speaking up and joing those assmunches.

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: 23 Sep 1998 16:32:25 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: colmk@innocent.com
Subject: Re: Perl & Java - differences and uses
Message-Id: <sar4styfu3q.fsf@camel.fastserv.com>

>>>>> "c" == colmk  <colmk@innocent.com> writes:

  >> : reese, read "computation: finite and infinite state machines" by marvin
  >> : minsky to learn about what is computable and what is not. computable and
  >> : algorithm are related. algorithm and methodology are not related.
  >> 

  c> cfaism is the best book of all time.

i almost agree. i posted the quote above. you don't truly understand
machines until you have read that book!

a good followup in a broader vein is godel, escher, bach. it covers the
halting problem and other computabilty issues with lots of other fun
stuff.

i have read both multiple times. it is about time to reread them (when i
get some tuits)

i am sure george has read both of them! :-)


uri

-- 
Uri Guttman                             Speed up your web server with Fast CGI!
uri@fastengines.com                                  http://www.fastengines.com


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

Date: 23 Sep 1998 20:32:25 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906582635.435261@thrush.omix.com>

George Reese <borg@imaginary.com> wrote:
	>snip<
: It is more complex than that and as I said, I don't remember the exact
: context here.  Do we really need to spend all this time analyzing this
: if you concede I am not arguing that everything should be OO?

	s/not/no longer/;

	>snip<
: What about it?  I can write one class and build an entire application
: from methods in that class by calling those methods procedurally.
:
: No behaviour, no objects.  There is nothing a language can do to
: enforce that.

	You now offer proof that regardless of the language, "enforcement"
	of one paradigm or another is impossible?  If so, we agree.

	Now by this statement, can we infer that it is acceptable for a
	language to not "enforce" one paradigm or another, based on the
	above proof that it simply can not be done?

	Following this line, Perl can not be bad simply because it does not
	enforce a paradigm.

	>snip<
: I believe I said something that it was ridiculous to ask how to make a
: small program like that easier.

	Would you mind offering us an approximate code line count at which
	point OO methodologies become "easier"?  Or more reliable,
	maintainable, scalable, etc. 

	In more clear terms, please define "large" as it relates to software.

	>snip<
: Well, you have the answer.

	Apparently.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Wed, 23 Sep 1998 16:40:01 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <36095CA1.6CB24CA0@min.net>

George Reese wrote:
> 
> John Porter <jdporter@min.net> wrote:
> :


> :> Zenin <zenin@bawdycaste.org> wrote:
> :> : With the exception of the last few posts from you,
> :> : the only thing you have done throughout this entire
> :> : thread is prove yourself a zealot.
> 
> He is claiming I said one thing.  I state another.  I clearly can
> never prove that I never said something.  Therefore the burden of
> proof is on him.  Saying you can look it up in Deja News is not
> evidence.  Without providing actual evidence, it is nothing more than
> bullshit.

As far as that goes, providing a citation into DejaNews is not
actually proof that you wrote the words; forgeries can happen.
Even so, if you want citations from DejaNews that illustrate that you
have spoken zealously, I will oblige.

By the way, how come the burden of proving one's claims doesn't
apply to you?

G: Python is way better than Perl!
J: Oh yeah? Prove it!
G: I don't have to prove it!  You have to prove me wrong!


> : I am particularly gratified that you encourage the use of a language
> : which *supports* the chosen paradigm, rather than *enforces* it.
> : By your statement above, Perl is an acceptable choice (perhaps not
> : the best) when the paradigm is OO.
> 
> Supports and enforces are the same thing in this context.  Perl is a
> particularly shitty choice of a language in an OO environment.

I think that "support" and "enforce" are not synonymous, regardless
of context.  These are the facts, as I understand them:
Enforce:
    Python and Perl enforce OO programming more or less equally
    (i.e. not much at all)
Support:
    Python supports OO programming much better than Perl does.
So even in the current context, I don't see how you can make the
claim that "support" and "enforce" are equivalent.


> :> My statements alone are not proof of where I stand?
> 
> : That's not the issue.
> : No one wants proof of where you stand.
> : We want proof for your claims.
> 
> Look, dumbass, you asked "Now are we clear on where you stand?" To
> which I responded as above.  This bullshit about taking a statement I
> CLEARLY made to support a direct question about being clear on where I
> stand and placing it as if it were supposed to be used as evidence in
> the argument ads a whole is 100% disingenuous and I have had enough of
> it.

O.k., I'm willing to admit that I was not communicating effectively
with you.  If it ever seemed like I was questioning how you really
feel about anything, I am sorry.  That was never my intention.  My only
intention has been to elicit from you some concrete supporting evidence
for your assertions.


> : The point I was trying to make was that Python does not enforce OO
> : any more than Perl does, and that some sample Python programs
> : presented in this thread provide supporting evidence.
> : The mere fact that non-OO Perl code can be transliterated directly
> : into Python proves that Python does not enforce OO programming.
> 
> : This, of course, should not be taken as a suggestion that Python
> : does not *support* OO much better than Perl; I have no doubt
> : that it does!
> 
> As I stated before, no language can enforce OO along the lines you are
> speaking of.

> ... claiming I am trying to argue from authority.  It is clear both
> you and Zenin are intentionally misrepresenting me and it has pissed
> me off to the boiling point.  I will not engage in any other
> discussions on that topic.

I am more than happy to drop that line; although I don't think
that's what the above-quoted messages were about...

-- 
John "Many Jars" Porter


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

Date: 23 Sep 1998 20:38:35 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906583005.817497@thrush.omix.com>

George Reese <borg@imaginary.com> wrote:
: In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
	>snip<
: : I am particularly gratified that you encourage the use of a language
: : which *supports* the chosen paradigm, rather than *enforces* it.
: : By your statement above, Perl is an acceptable choice (perhaps not
: : the best) when the paradigm is OO.
:
: Supports and enforces are the same thing in this context.  Perl is a
: particularly shitty choice of a language in an OO environment.

	And then later in the same post you state:

	>snip<
: As I stated before, no language can enforce OO along the lines you are
: speaking of.

	Or more correctly, no language can enforce OO at all (as you
	yourself proved in another post), thus "supports" and "enforces"
	are (as they are in ENGLISH) two very, very different terms.
-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Wed, 23 Sep 1998 16:48:31 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <36095E9F.19EB2B5F@min.net>

George Reese wrote:
> 
> In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
> : George Reese wrote:
> :>
> :> Zenin <zenin@bawdycaste.org> wrote:
> :> : What if Java had closures.  Would it be "wrong" to actually use them?
> :> : Or would Java some how be less of a language for even supporting
> :> : such a paradigm?
> :>
> :> Java has method pointers.  A similar concept that does work in an OO
> :> paradigm.
> 
> : The argument is not about whether Java does *in fact* have closures,
> : or *should* have closures.
> 
> : The question is, IF java supported functional programming to some
> : extent, would it be wrong to use those features?  Or perhaps would
> : Java be less of a good choice for doing OO programming because of it?
> 
> : Now, I don't particularly care what your answer might be.
> : I just was bothered by your misapprehension of the question.
> 
> I did not misunderstand the question.  I answered it.  I said that in
> fact it had something similar and that the concept was captured in an
> OO framework--not in a functional framework.

I hate to go round about this again, but...
You did not answer the question.  
Zenin (and I) did not ask whether Java has closures, or any other
mechanism typically found in functional languages.  Yet that is
the only question you have answered.

Ignore "closure", and any other buzzword.  Let's talk about concepts.

If (hypothetically) Java supported some mechanisms which are, by
definition, functional in nature, would you advise Java programmers
not to make use of them, being as how they are not OO features?
Or, possibly, would you recommend that OO practitioners consider
a different language, one which doesn't dilute the purity of OO?

If you have a hard time relating this question to Java per se,
think of a hypothetical language which is better than Java in
all OO respects, but with the addition of the aforementioned
functional features.


> Method pointers/closures/functionals etc are not inherently
> functional.

I can only assume from this that you don't know Lisp.

-- 
John "Many Jars" Porter


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

Date: Wed, 23 Sep 1998 14:48:09 -0500
From: "Holser, Paul [RICH2:2V92:EXCH]" <pholser@americasm01.nt.com>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <36095079.EE549368@americasm01.nt.com>

John Porter wrote:
[snip]
> So here's a poll for everyone.
> 
> From what resource(s) did you learn Perl?

   Llama v.1
   Llama v.2
 x Camel v.1
 x Camel v.2
   Other book (give name)
 x Docs included in the distribution
   Something on the WWW
   Studying existing code
   Class/tutor
 x Shiny Ball book

I found these resources to be adequate.  Having
come from a C/awk/sh background, Perl was--is--
the natural next step for me.  But hey,
TMTOWTDI.

I'm reading through the "Perl Cookbook" like a
novel at this time, and finding out every step of the
way how much more Perl there is to learn.  8^)

Thanks for allowing me to share.

Cheers,
p
-- 
// Paul Holser ~ Northern Telecom, Inc. ~ pholser@nortel.com
// These thoughts are mine, take 'em or leave 'em.
// Be a person, not a persona; have a life, not a lifestyle;
// have character, don't be one.  --PRH


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

Date: Wed, 23 Sep 1998 20:10:04 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <wAcO1.608$_c5.5468368@news.shore.net>

Randal Schwartz (merlyn@stonehenge.com) wrote:

: Heh.  That's a matter of public record.

Crackhead.

--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>


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

Date: Wed, 23 Sep 1998 20:12:21 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <8cn27qvbao.fsf@gadget.cscaper.com>

>>>>> "Colin" == Colin Kuskie <ckuskie@cadence.com> writes:

Colin> I don't know why Randal
Colin> left.  Nobody beat him up, maybe he's just overwhelmed by the volume.

Define "left".  That's not right. :)

-- 
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: 23 Sep 1998 19:44:44 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <36094EFF.E91230F2@vpservices.com>

Hey, you left off the most important one:  Monkeying around and seeing
what happens.

In order chronologically (1992 to present):
  * Docs included in the distribution
  * Monkeying around and seeing what happens
  * Camel v.1
  * Something on the WWW
  * Studying existing code
  * comp.lang.perl.*
  * Llama v.1
  * Camel v.2
  * Owl v.1 (Mastering Regular Expressions)

In order by current importance:
  * Monkeying around and seeing what happens
  * Camel v.2
  * Studying existing code
  * comp.lang.perl.*
  * Owl v.1 (Mastering Regular Expressions)

An earlier poster promised to let us know when he is done learning perl.
Sorry, I can't make that promise - by that time the sound of them
nailing my coffin shut will be too loud.

- Jeff Zucker


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

Date: 23 Sep 1998 20:13:58 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <6ubkq7$hs3$1@marina.cinenet.net>

John Porter (jdporter@min.net) wrote:
: From what resource(s) did you learn Perl?

Llama v.2

 ...followed immediately by excursions into the Camel and online docs, then
other books, of course.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: 23 Sep 1998 20:31:33 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <6ublr5$7to1@mercury.adc.com>

In article <8czpbqvcvd.fsf@gadget.cscaper.com>,
Randal Schwartz  <merlyn@stonehenge.com> wrote:
>>>>>> "Rich" == Rich Grise <richgrise@entheosengineering.com> writes:
>
>Rich> "How did you learn enough perl to get yourself into serious trouble?"
>
>Heh.  That's a matter of public record.
>
>:-)
>
>(See http://www.lightlink.com/fors/ and http://www.rahul.net/jeffrey/ovs/
>if you are unfamiliar with my on-going legal battles.)

Jeez, that's such a great lead-in I can't possibly pass it up.

For you Dallasites and Fort Worthies who don't already know, Randal
will be in Dallas on October 3rd to give his "Just Another Convicted
Perl Hacker" talk.  The particulars are as follows:

      Time:    2:00pm Saturday, October 3rd
      Place:   Skybridge III room, Doubletree Hotel at Lincoln Center
               5410 LBJ Freeway (635 and Dallas North Tollway)
      Cost:    None... 
      Contact: Brand Hilton <bhilton@adc.com>

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: 23 Sep 1998 20:38:00 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: question about variable interpolation in search pattern
Message-Id: <6ubm78$n3t$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Richard Ann 
<rann@bbn.com>],
who wrote in article <360918BD.4F31@bbn.com>:

> $foo = 'there';
> $template_line = 'hello $foo';

>     if($line =~ /$template_line/) {

> I cannot figure out what the end-result search pattern is.

When in doubt, use 

     -Mre=debugcolor

on the command line (assuming 5.005).

> I know that a
> variable in a search pattern is interpolated, after which the search
> pattern is recompiled. This would mean that 
> 
>     $template_line 
> 
> gets interpolated into 
> 
>     hello $foo
> 
> because of the single instead of double quotes that are used.
> 
> I would think that here this would get recompiled

Why?  Perl has no double interpolation, it is not sh or 4dos.

Ilya


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

Date: Wed, 23 Sep 1998 14:26:05 -0600
From: BYU Library <library@byu.edu>
Subject: Running CGI Perl scripts on NT Netscape Enterprise 3.01 server
Message-Id: <3609595D.FB78702@byu.edu>

I just installed perl onto my NT server running NS ES 3.01.  I have made
associations of the .pl files and application/x-perl in Explorer.  My
test perl scripts run fine from the command line.  When I try to run
them from a CGI directory, it gives:
Server Error

This server has encountered an internal error which prevents it from
fulfilling your request. The most likely cause is a
misconfiguration. Please ask the administrator to look for messages in
the server's error log.

My log file has the following errors:
[23/Sep/1998:14:20:24] failure: for host webspirs.lib.byu.edu trying to
GET /cgi-bin/test.pl, send-cgi reports: could not send new process
(Error Number is unknown)
[23/Sep/1998:14:20:24] failure: cgi_send:cgi_start_exec
c:\netscape\SuiteSpot\cgi-bin\test.pl failed

I was able to get perl to run under IIS, but I can't find my notes.  Any
help?

Bill
library@byu.edu




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

Date: 23 Sep 1998 16:26:19 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: send geroge reese (was Re: Call for Participation: Python Conference)
Message-Id: <sar67eefudw.fsf@camel.fastserv.com>

>>>>> "JH" == Jeremy Hylton <jeremy@cnri.reston.va.us> writes:

  JH> Call for Participation

  JH> 7TH INTERNATIONAL PYTHON CONFERENCE
  JH> http://www.foretec.com/python/workshops/1998-11/

let's send george reese. he'll teach them a thing or two about OO and
debating.

uri

-- 
Uri Guttman                             Speed up your web server with Fast CGI!
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Wed, 23 Sep 1998 16:09:43 -0700
From: MadMonkey <samblack@earthlink.net>
Subject: sock the heck out of port 23
Message-Id: <36097FB7.D589E937@earthlink.net>

Hi guys.
   I'm having a weird problem. I wrote a simple little prog that should
connect to the server I tell it to on the port I tell it to.
         --- it does---     except for port 23.
For every other port (let's say sendmail) it spits out the appropriate
junk like This is sendmail 43.45.5.6.76.45.43 ya know....
       but when connecting to port 23 ... it connects... then just sits
there....
Could anyone help or maybe give me an example code to work off of to
connect to telnet port?
       thanks!!!
         J



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

Date: 23 Sep 1998 15:19:12 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: unlink() not working in NT!!??
Message-Id: <6ubl41$svu@fumnix.metronet.com>

) In article <36085a50$0$25505@nntp1.ba.best.com>,
) 	"David Watson" <standfast@mindspring.com> writes:
) 
) > # The open() succeeds.  The unlink() fails only on NT.

mgjv@comdyn.com.au (Martien Verbruggen) writes:
) You don't close the file. On some operating systems, and I believe
) that includes NT, file locking happens.
) 
) If you know that unlink fails, you should inspect the $! variable.
) Whenever you use a system call and it fails, check $!.

Under WinNT, when you open a file, you can specify what combination
of reading, writing, and deleting can be done while you have it
open.  The C library [which is what Perl calls] always specifies
that reading and writing can be done but not deleting [at least for
the C library that I have source for, MS VC++ 5.0].

To specify otherwise, you have to open the file using Win32's
native CreateFile() call.  Unfortunately, the C libraries don't
define a standard way for you to turn a Win32 handle from
CreateFile() into a C file handle so you can't do most Perl
things on that file via that handle.

One feasible solution for this is to write a module to tie
a Win32 native handle as a Perl file handle.  If anyone is
interested in writing this, I can give them pointers.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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