[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Potential MacPerl column?



At 7:52 PM -0800 2/17/00, David Steffen wrote:
>   Brian: thank you for volunteering to coordinate the MacPerl column!

(Very smooth, David ;) Yeah, Brian, I'm sure everyone thinks that's what
you said...

>   Please find appended a first draft of an idea I had.

Excellent, excellent, David!

I'm sure others on the list can quickly clarify the cgi/acgi issues. Also a
little more about AppleScript/AppleEvents, perhaps? For example, you might
be right when you say

>When a web browser requests your CGI, it will begin running, service
>the request, and remain running for 5 minutes.  This allows the CGI
>to service multiple requests more quickly as it doesn't have to
>restart each time.

If I understand you, you're saying that the CGI remains running for five
minutes; I thought it was an instance of an AppleScript script that
continues running, one that handles calls _to_ that particular CGI. Someone
can surely clarify.

As a note to what you said about how to deal with those http quit-me's
before editing: I use local CGI for the first two of the three purposes you
mention, so it's not unusual that there would be several of those layered
among the windows on my screen, with nothing stating which CGI they're
related to. To cope with this, I use the detachable finder menu (w/ tiny
icons) so I can watch each one's icon appear when a new CGI is requested,
and then quickly switch to and quit the right one if I'm going to edit that
CGI script.

But anyway, what you've written is great and would be useful to many as an
article. I'd say expand it slightly, touch a few more topics and add a few
more sentences here and there, where you were on the terse side...

Brian: Regarding article proposals: I've been collecting notes on the
dynamic trio map, grep, and sort. For some reason I was struck by lightning
recently in seeing the common structure of these three for the first time,
even though I've been using them for years.

Summary:
The Perl "functions" map, grep, and sort each starts with a list, carries
out an operation with each successive element of that list, and then
returns a second list. The relationship of the second list to the first is
determined by the value of the operation as employed each in its own way by
the three functions.

@list2 = map|grep|sort  {
	# do a simple or complex operation and return a value
	# once for each element of @list1
} @list1;

With map, the second list holds the values returned by the operation for
each element of the first list, in the order of the first list elements.
With grep, the second list holds those elements of the first list for which
the operation returned a true value; the elements of the second list are
unchanged and in the order of the first list. With sort, the second list
holds all the elements of the first list, unchanged, in the order of the
value returned by the operation for each element of the first list.

An article could expand on this and give examples of simple and complex
operations, and various combinations of the three functions. Since I've
just gotten to the first grok level above duh with these, I'm sure there
are others who could give deeper explanations and more useful and/or cool
examples. And I'd guess there would be plenty of people who'd appreciate a
good elucidation of these powerful list manipulators. Anyone tempted? I'll
keep saving ideas, and maybe have time in May or June to draft something,
but don't anyone else hold back. (I owe Brian something aready, anyway...)

1;



- Bruce

__Bruce_Van_Allen___bva@cruzio.com__Santa_Cruz_CA__

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org