[6752] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 377 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 26 14:07:10 1997

Date: Sat, 26 Apr 97 11:00:22 -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           Sat, 26 Apr 1997     Volume: 8 Number: 377

Today's topics:
     Re: 2D matrices (Chipmunk)
     Re: Automatic NNTP Usenet news reader & posting perl sc (Nathan V. Patwardhan)
     Books available online? (Henrik Caqadas)
     Re: CGI scripts (Tad McClellan)
     Re: Evoke one *.pl in another? (Tad McClellan)
     Genetic programming with Perl (Zachary Brown)
     Re: Object IDs are bad (was: Ousterhout and Tcl lost th <tonyk@cybercom.net>
     Re: Object IDs are bad (was: Ousterhout and Tcl lost th <erik@naggum.no>
     Re: Object IDs are bad (was: Ousterhout and Tcl lost th <bhouse@dazsi.nospam.com>
     Re: Object IDs are bad (was: Ousterhout and Tcl lost th <thant@nospam.acm.org>
     Re: Odd array sizing information (Chipmunk)
     Re: queuing forks <apena@cubi210.fi-b.unam.mx>
     Re: raw input (Chipmunk)
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     Re: switch and if (Chipmunk)
     Re: Trouble with Emacs auto formatter (Chipmunk)
     Re: undump revisited? <rsmith@proteus.arc.nasa.gov>
     Re: undump revisited? <tchrist@mox.perl.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 26 Apr 1997 15:52:50 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: 2D matrices
Message-Id: <5jt8ci$b4e$4@dartvax.dartmouth.edu>

In article <5jpu2b$q3b@info.abdn.ac.uk>
junkmail@sysa.abdn.ac.uk (Kyzer) writes:

> In general, but why should have to type man perlLoL ? It's one of the
> misgivings of unix; function names are case dependent (good), but the
> man pages are too; therefore they make most function names in unix
> lowercase because programmers prefer all-lowercase.
> 
> That's just stupidity. (I would welcome a 'man -i' a-la grep -i)

Or it could be like 'rm -i'

% man -i perlLoL
man: lookup perlLoL?

Chipmunk


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

Date: 26 Apr 1997 13:55:36 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Automatic NNTP Usenet news reader & posting perl scripts.
Message-Id: <5jt1go$fis@fridge-nf0.shore.net>

Drake Raft (drake-@email.unc.edu) wrote:
: Hello there.  I am looking to automate the reading, indexing and
: posting of news to a couple of usenet newsgroups.  

No spamming, please.

: Would anyone know where I might start?  

http://www.perl.com/CPAN/modules/by-module/News/

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Sat, 26 Apr 1997 17:53:47 GMT
From: henrik@ludd.luth.se (Henrik Caqadas)
Subject: Books available online?
Message-Id: <335ff5e9.34816469@news.ludd.luth.se>

Is there any recommendable Perl book for beginners available on-line
for free or for evaluation purpose?
--
Henrik Caqadas
henrik@ludd.luth.se


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

Date: Sat, 26 Apr 1997 09:07:47 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: CGI scripts
Message-Id: <j72tj5.3l4.ln@localhost>


Jeremy D. Zawodny (jzawodn@bgnet.bgsu.edu) wrote:
: On Thu, 24 Apr 1997, Paula Chase wrote:

: > We use best.com in California, and they let us use whatever CGI's we
                                                                ^^^^^
: > want.  And their prices are very reasonable.

: <sarcasim>
: Hm.  Wasn't aware of more than one CGI.  I guess I figured that the NCSA
                       ^^^^^^^^^^^^^^^^^
: implementation from a few years ago was good enough.
: </sarcasim>


I think she said something belonging to CGI rather than plural CGI...  ;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Sat, 26 Apr 1997 09:21:15 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Evoke one *.pl in another?
Message-Id: <r03tj5.1n4.ln@localhost>

Chris Zeth (cwzeth2@nis.net) wrote:
: Hi All,

: How do I run program.1.pl and have this be a simple call to run
: program.2.pl?


You basically do it the way the Perl FAQ (part 8) says to:

-----------------------------
=head2 How can I capture STDERR from an external command?

There are three basic ways of running external commands:

    system $cmd;                # using system()
    $output = `$cmd`;           # using backticks (``)
    open (PIPE, "cmd |");       # using open()

With system(), both STDOUT and STDERR will go the same place as the
script's versions of these, unless the command redirects them.
Backticks and open() read B<only> the STDOUT of your command.

With any of these, you can change file descriptors before the call:

    open(STDOUT, ">logfile");
    system("ls");

or you can use Bourne shell file-descriptor redirection:

    $output = `$cmd 2>some_file`;
    open (PIPE, "cmd 2>some_file |");

You can also use file-descriptor redirection to make STDERR a
duplicate of STDOUT:

    $output = `$cmd 2>&1`;
    open (PIPE, "cmd 2>&1 |");

Note that you I<cannot> simply open STDERR to be a dup of STDOUT
in your Perl program and avoid calling the shell to do the redirection.
This doesn't work:

    open(STDERR, ">&STDOUT");
    $alloutput = `cmd args`;  # stderr still escapes

This fails because the open() makes STDERR go to where STDOUT was
going at the time of the open().  The backticks then make STDOUT go to
a string, but don't change STDERR (which still goes to the old
STDOUT).

Note that you I<must> use Bourne shell (sh(1)) redirection syntax in
backticks, not csh(1)!  Details on why Perl's system() and backtick
and pipe opens all use the Bourne shell are in
http://www.perl.com/CPAN/doc/FMTEYEWTK/versus/csh.whynot .

You may also use the IPC::Open3 module (part of the standard perl
distribution), but be warned that it has a different order of
arguments from IPC::Open2 (see L<IPC::Open3>).
-----------------------------


: If this is possible, can I send a query variable as well? For example, I
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Yep, but that is not a perl question.

Please ask it in the CGI newsgroup: comp.infosystems.www.authoring.cgi

(It depends on whether you want to do GET, POST, or simply pass it
 in @ARGV)


: am calling program.2.pl like this: 

:    /cgi-bin/program.2.pl?QUERY1

: How can I included this query variable within the call to this script?


# run it getting only the return value (does not get the output)
system "/cgi-bin/program.2.pl" && die "system() call failed  $!";


# run it and get ALL the output into an array
@prog2_output = `/cgi-bin/program.2.pl`;   # backwards single quotes


# run it, and get the output line-by-line
open(P2, "/cgi-bin/program.2.pl |") || die "could not fork";
while (<P2>) {
   # do something with the line in $_
}
close(P2);



: Thanks!

You're welcome.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 26 Apr 1997 10:43:01 -0400
From: zbrown@lynx.dac.neu.edu (Zachary Brown)
Subject: Genetic programming with Perl
Message-Id: <5jt49l$j6@lynx.dac.neu.edu>


Genetic programming would go perfectly on perl. Has anyone written a 
library to generate random perl code (random within user-defined 
parameters, of course)?

Zack



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

Date: 26 Apr 1997 10:24:57 -0400
From: Antoun Kanawati <tonyk@cybercom.net>
Subject: Re: Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <m24tctuaiu.fsf@cybercom.net>

Peter Ludemann <ludemann@inxight.com> writes:
: ...
: But let's suppose that you really really really do need to identify a
: particular subtree.  In other words, you want to NAME it.  No problem:
: just create a dictionary (hash table) that maps names to subtrees.
: That'll let you have two differently named entries which might happen
: to have the same values.  And it won't expose pointers.  And it'll be
: efficient.

I don't get it.  Object identity is "bad", but when we need it, and
very often, we do, we must go through hoops and program against a
small in-memory relational database instead?

Pointers are bad, but pointers are not "object identity".  Identity is
available in languages like LISP, Smalltalk, and Java which have
garbage collection, and is quite reliable too.

: Repeat after me: "if two things look the same and act the same, then
: they are the same".  Don't depend on some hidden property (pointer) to
: differentiate them.  If there are important differences, then don't be
: shy: bring them out in the open and NAME them.

So, if you need identity, you should implement it yourself.
Furthermore, you should insure not only that your implementation is
correct, but also that every usage is correct!

The implications of your statement, stated in quasi-religious tones,
are as follows:

1. Without identity, you need to lookup every object by name.
2. And, when the object state changes, you must shove that named
   object back into the table because you can't be sure that the new
   state is the "same" object you've looked up from the table.
3. Furthermore, since you don't have identity, your object lookup data
   structure must go through the same hoops as the application, or
   ... it must be based on object identity.
4. And, now, the lookup strcuture must be passed as an argument to
   everything you call, since subjecting it to mutations while
   avoiding object identity means that you have to name it too.
5. And, now, your program must be written in strict continuation
   passing style, because you want to make sure that the lookup
   structure is the most current at any point in time.

Or, in much simpler words, the implication is: program in purely
functional style.  Not a bad thing by itself, but a much bigger
statement than "object identity is bad".

: [I once took an object-oriented database that used object-IDs and
: translated it to a relational form which just used names for things;
: performace improved by about about an order of magnitude.  But that's
: another rant for another day ...]

Well, your little story simply indicates that you had a bad OODB
and/or an excellent RDB.  It is hard to imagine the general case where
table lookups from a relational database can be inherently faster than
the traversal of a persistent pointer.
-- 
Antoun (Tony) Kanawati
tonyk@cybercom.net
http://www.cybercom.net/~tonyk


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

Date: 26 Apr 1997 15:22:51 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <3071056971024295@naggum.no>

* Andrew Koenig
| But now suppose we want to be able to identify a specific subtree of a
| tree.  If I had gone to the trouble of creating a tree abstraction in
| C++, I could identify a particular subtree by the address of its root.
| But there's no corresponding facility in ML.  Trees are values, and
| although one can compare them for equality, there is no notion of object
| identity.

* Peter Ludemann
| Absolutely correct and correctly so.
| 
| If two things LOOK the same, then they ARE the same.  It's called
| "referential transparency" and it's a Good Thing, as opposed to
| "pointers" which are a Bad Thing.  Why confuse your life with "object
| identity"?

it seems to me that there is some confusion between two meanings of "object
identity".  one meaning is that you can test for object identity with an
operator of some kind.  in Lisp, that's `eq'.  C has `=' when applied to
pointers.  this meaning implies that "object identity" is a value of some
sort, but in Lisp this value _is_ the object as far as the language is
concerned.  in C, the object identity _is_ a pointer, and the value is
something it points to.  this leads to the other meaning, that object
identity is a separate _type_ apart from objects, such as pointers in C.
the distinction may be useful in smoe situations, but those mostly have to
do with the allocation of objects in memory.  but regardless of how memory
is organized and used, an object is itself, and it is useful to know
whether two objects are identical, provided you can get more than one
handle on an object in the first place.  Peter Ludemann seems to think that
something other than the memory address of the object should be used for
this purpose, and that is a perfectly legitimate point, however silly.

part of the problem with pointers is that languages such as C and C++ force
you to remember the difference between a pointer and a pointed-to-value,
even though the language is supposedly strongly typed and the compiler
perfectly well knows when you get it wrong.  e.g., if you declare struct
foo *bar;, it should not be a terribly hard task for the compiler to
understand that bar.zot means the field "zot" of the structure _pointed_to_
by bar, but oddly enough, you have to write bar->zot or (*bar).zot to do
that, which is just idiotic.  such is what you get when you combine "the
compiler shouldn't be smarter than its users" with the artificial
distinction between values and pointers to them.  however, this is _not_
because of "object identity", but rather because the language conflates
object identity with the pointer type and exposes the latter to the
programmer in a way that destroys any concept of "object" and just leaves
"untyped block of memory" in its place.

I have no idea whether Peter Ludemann had a third meaning of "object
identity" in mind, and I don't know whether Andrew Koenig knows ML well
enough that it is true that ML doesn't offer object identity, but it seems
rather obvious to offer object identity if you offer composite types.  what
little I know about ML suggsts that ML _must_ offer object identity.  (how
else would you be able to talk about the constituent objects of a composite
object?)  anybody knowledgeable in ML want to explain this further?

#\Erik
-- 
if we work harder, will obsolescence be farther ahead or closer?


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

Date: 26 Apr 1997 15:34:55 GMT
From: "Bill House" <bhouse@dazsi.nospam.com>
Subject: Re: Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <01bc5255$dbbe2260$03d3c9d0@wjh_dell_133.dazsi.com>

Fergus Henderson <fjh@murlibobo.cs.mu.OZ.AU> wrote in article
<5js6vq$8mm@mulga.cs.mu.OZ.AU>...
> 
> Martin Odersky has a nice solution to this problem --
> a way to get globally unique labels in a local scope
> without violating referential transparency, so that you
> can do this sort of thing without the entire system needing to
> know about the labels.  See his paper on the lambda-nu calculus,
> which is available from his home page (don't have a URL on-hand
> right now, sorry).  
>

Try http://wwwipd.ira.uka.de/Odersky/Archive

Bill House
-- 
http://www.dazsi.com
Note: my e-mail address has been altered to
confuse the enemy. The views I express are
mine alone (unless you agree with me).




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

Date: Sat, 26 Apr 1997 08:41:24 -0700
From: Thant Tessman <thant@nospam.acm.org>
Subject: Re: Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <33622224.41C6@nospam.acm.org>

Andrew Koenig wrote:

[...]

> My original posting was a response to someone who said something to the
> effect that languages without closures, lambda expressions, etc. were
> inferior.  So I gave an example of a problem I would like to be able to
> solve that at least one such langauge does not make easy to solve.
> 
> The reply to that is ``You shouldn't be wanting to solve that problem;
> not being able to do so is a Good Thing.''
>
> [...]

Just to make things clear to folks, I was the one that said languages with 
higher-order functions are superior.  And the above was not my reply.

The example Koenig brought up tried to show that sometimes you want to use 
the concept of object-identity to make solving certain kinds of problems 
easier.  I don't disagree.

What I disagreed with (object to!) is Koenig's implication that C++'s use 
of addresses as a "built-in" concept of object identity is in anyway 
superior to SML's use of references.   (The imperitave versus functional 
argument is interesting, but irrelevant with regard to SML (the example 
language brought up) because it supports both (as does Lisp).)

-thant

[...followups trimmed...]


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

Date: 26 Apr 1997 15:31:03 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Odd array sizing information
Message-Id: <5jt73n$b4e$2@dartvax.dartmouth.edu>

In article <E97E5I.Krr@nonexistent.com>
abigail@fnx.com (Abigail) writes:

> On Fri, 25 Apr 1997 14:47:27 GMT, Eric Bohlman wrote in
> comp.lang.perl.misc <URL: news:ebohlmanE977r3.4nF@netcom.com>:
> ++ 
> ++ Chipmunk (Ronald.J.Kimball@dartmouth.edu) wrote:
> ++ : Does that mean you'll have to stop using Perl when it supports arrays
> ++ : with
> ++ : complex numbers of elements?
> ++ 
> ++ Logically, a two-dimensional array is equivalent to a one-dimensional 
> ++ array indexed by complex numbers.  Are there any plans to allow 
> ++ subscripting 2-D arrays with polar coordinates in the near future?
> 
> Since when do people use real numbers to index their arrays?
> Arrays are indexed using natural numbers, and 2-D arrays with
> elements of N x N. The Carthesian product of N with N is in
> no way equivalent with C (the set of complex numbers).
> 
> There is of course a 1-1 mapping between N x N and rational 
> numbers....

Some people just can't get a joke.

Chipmunk


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

Date: Sat, 26 Apr 1997 02:14:49 -0700
From: Antonio Peqa <apena@cubi210.fi-b.unam.mx>
To: Rich Schramm <rdschramm@scripps.com>
Subject: Re: queuing forks
Message-Id: <3361C789.43FB@cubi210.fi-b.unam.mx>

Rich Schramm wrote:
> 
> Does anyone have a code snippet that does process queuing like I am trying
> to do (i.e., fork a new child everytime one returns until all the necessary
> children are done?)
> 
Rich:

Just the other day I wrote a modem dialing script that has to dial many
sites and decided to fork several children to do the job faster. I do
not have the exact code at hand (if you want it, please contact me
again), but it goes something like this:

  # The trick !
    $SIG{CHLD} = sub { $Forked -= 1; wait; };

  # The number of initial children and the maximum limit
    $Forked = 0;
    $MaxForked = 10;  # 10 or whatever (it is actually something from
getopt())

  # The main loop
    foreach $Item (@List) {

    # Wait when all children are running
      while ($Forked >= $MaxForked) { 
        sleep ??;  # I actually sleep my loop a random amount of time
      }

    # Fork a new child for this $Item
      $ChldPID = fork();
      if (defined($ChldPID)) {
        if ($ChldPID != 0) {
          # The parent
        } else {
          # The child

            exit;
        }
      } else {
        # Unable to fork !
      }
    }

Works for you?

Since I am using public resources on a rather long run I also like to
have:

  $SIG{USR1} = sub { $MaxForked += 1; };
  $SIG{USR2} = sub { $MaxForked -= 1; };

Just in case I have to decrease or increase the number of children
during a run.


Hope it helps !
APena


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

Date: 26 Apr 1997 15:56:44 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: raw input
Message-Id: <5jt8js$b4e$5@dartvax.dartmouth.edu>

In article <5jpui7$q3b@info.abdn.ac.uk>
junkmail@sysa.abdn.ac.uk (Kyzer) writes:

> Sascha Teske, while smelling of fish, wrote:
> : I have a Problem i want to write an more intelligent chat and want to 
> : use perl is there a way to get data before or without a newline "amen" ?
> : don't say RTFM to me, I DID !!!
> 
> Perl keeps newlines because it hsn't been told not to.
> The easiest way to fix it is:
> 
> $my_string_with_newline = "Hello wurld\n";
> 
> chop($my_string_with_newline);          # now it's "Hello wurld" no newline

That's a good way to remove newlines (chomp is better, if you have
perl5)
but that's not what Sascha asked about.  The problem is how to get data
without having to wait for a newline.

I'd offer a suggestion here, but I haven't a clue how to do it.  ;-)

Chipmunk


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

Date: 26 Apr 1997 17:26:09 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <5jtdrh$e3g$1@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 19 Apr 1997 09:08:21 GMT and ending at
26 Apr 1997 06:22:50 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^(>|:|\S+>)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.

Excluded Posters
================

perlfaq-suggestions@mox.perl.com

Totals
======

Total number of posters:  540
Total number of articles: 1199
Total number of threads:  407
Total volume generated:   2294.6 kb
    - headers:    936.4 kb
    - bodies:     1279.9 kb (909.9 kb original)
    - signatures: 75.6 kb

Averages
========

Number of posts per poster: 2.2
Number of posts per thread: 2.9
Message size: 1959.7 bytes
    - header:     799.8 bytes
    - body:       1093.1 bytes (777.1 bytes original)
    - signatures: 64.6 bytes

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   43    66.9 ( 34.9/ 31.9/ 21.6)  Tom Phoenix <rootbeer@teleport.com>
   35    69.8 ( 21.5/ 48.2/ 28.1)  Tad McClellan <tadmc@flash.net>
   32    58.2 ( 18.0/ 40.2/ 24.3)  David Alan Black <dblack@icarus.shu.edu>
   30    60.8 ( 23.7/ 32.2/ 19.6)  Tom Christiansen <tchrist@mox.perl.com>
   26    36.8 ( 15.9/ 20.8/ 16.1)  Nathan V. Patwardhan <nvp@shore.net>
   26    42.6 ( 17.6/ 25.0/ 18.3)  dev.null
   21    41.9 ( 14.6/ 20.9/ 13.8)  Eryq <eryq@enteract.com>
   21    34.1 ( 15.4/ 18.7/ 10.1)  Alastair Aitken <a.aitken@unl.ac.uk>
   13    15.7 (  8.7/  6.9/  3.6)  Chipmunk <Ronald.J.Kimball@dartmouth.edu>
   12    21.5 (  7.2/ 10.6/  7.1)  mike@stok.co.uk

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  69.8 ( 21.5/ 48.2/ 28.1)     35  Tad McClellan <tadmc@flash.net>
  66.9 ( 34.9/ 31.9/ 21.6)     43  Tom Phoenix <rootbeer@teleport.com>
  60.8 ( 23.7/ 32.2/ 19.6)     30  Tom Christiansen <tchrist@mox.perl.com>
  58.2 ( 18.0/ 40.2/ 24.3)     32  David Alan Black <dblack@icarus.shu.edu>
  43.7 (  7.6/ 33.6/ 25.4)      8  Paul Wilson <wilson@cs.utexas.edu>
  42.6 ( 17.6/ 25.0/ 18.3)     26  dev.null
  42.3 ( 13.6/ 27.9/ 27.9)     12  Erik Naggum <erik@naggum.no>
  41.9 ( 14.6/ 20.9/ 13.8)     21  Eryq <eryq@enteract.com>
  36.8 ( 15.9/ 20.8/ 16.1)     26  Nathan V. Patwardhan <nvp@shore.net>
  34.1 ( 15.4/ 18.7/ 10.1)     21  Alastair Aitken <a.aitken@unl.ac.uk>

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   72  Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
   39  Ousterhout and Tcl lost the plot with latest paper
   20  Perl as its own metalanguage?
   19  Who will win?  Borland or Microsoft or Programmers?
   16  No syntax errors, but still the thing won't run
   15  Odd array sizing information
   14  They both suck! (was: Borland or Microsoft compilers ?)
   14  Notice to antispammers
   13  Get Chars up to first | without splitting
   12  Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

 223.5 ( 87.5/133.0/ 94.4)     72  Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
 117.9 ( 44.0/ 71.8/ 51.4)     39  Ousterhout and Tcl lost the plot with latest paper
  61.3 ( 35.9/ 25.0/  7.0)     19  Who will win?  Borland or Microsoft or Programmers?
  41.5 ( 12.5/ 28.6/ 19.8)     16  No syntax errors, but still the thing won't run
  40.4 ( 15.0/ 22.0/ 13.8)     20  Perl as its own metalanguage?
  39.2 ( 21.7/ 16.8/  6.7)     14  They both suck! (was: Borland or Microsoft compilers ?)
  28.2 ( 15.6/ 11.0/  6.5)     11  Unix and ease of use  (WAS: Who makes more ...)
  27.8 ( 10.9/ 16.0/ 11.6)     14  Notice to antispammers
  24.1 ( 10.8/ 11.0/  7.7)     15  Odd array sizing information
  23.7 ( 13.4/  9.8/  5.2)     12  Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

     219  comp.lang.tcl
     215  comp.lang.c++
     165  comp.lang.lisp
     165  comp.lang.scheme
     154  comp.lang.functional
     153  comp.lang.python
     153  comp.lang.eiffel
     130  comp.lang.scheme.scsh
      66  comp.unix.advocacy
      66  comp.os.linux.advocacy

Top 10 Crossposters
===================

Articles  Address
--------  -------

      91  Erik Naggum <erik@naggum.no>
      78  Mark Bracey <mbracey@interaccess.com>
      71  Henry Baker <hbaker@netcom.com>
      64  Paul Wilson <wilson@cs.utexas.edu>
      58  Cyber Surfer <cyber_surfer@gubbish.wildcard.demon.co.uk>
      55  Chris Bitmead uid(x22068) <Chris.Bitmead@alcatel.com.au>
      50  prasadm@polaroid.com
      48  kem@franz.com
      48  Thant Tessman <thant@nospam.acm.org>
      44  chas@aol.com


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

Date: 26 Apr 1997 15:27:10 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: switch and if
Message-Id: <5jt6se$b4e$1@dartvax.dartmouth.edu>

In article <335F3623.20BF@unl.ac.uk>
Alastair Aitken <a.aitken@unl.ac.uk> writes:

> iqbal gandham wrote:
> > Chipmunk wrote:
> > > In article <335E3B6E.39D8@prestel.net>
> > > iqbal gandham <igandham@prestel.net> writes:
> > >
> > > > Is it better to use an if statement or switch, or doesn't it make much
> > > > difference.
> 
> > > You are absolutely right about that.  There is no reason to use
> > > multiple if/else statements like that in Perl, when Perl's switch
> > > statement will do the same thing much more efficiently.
> > >
> 
> Ok - confused now.  I thought, as Abigail said, that there was no
> switch/case statement in perl and
> that effective switch/case statements coud be written using
> if/elsif/else constructs.
> 
> I think Chipmunk is wrong here .. or amd I?

I think Chipmunk was pulling someone's leg.

BTW, you can also write effective case statements using the following
construct:

CASE: {
   $var eq "case1" && (&do_sub1, last CASE);
   $var =~ /case2/ && (&do_sub2, last CASE);
   &do_default;
} continue {
   &do_whatever;
}

Chipmunk


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

Date: 26 Apr 1997 15:49:13 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Trouble with Emacs auto formatter
Message-Id: <5jt85p$b4e$3@dartvax.dartmouth.edu>

In article <5jqv3i$frq$1@mathserv.mps.ohio-state.edu>
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:

> Note that the latest CPerl mode (if used with latest Emacs's, starting
> from 19.34.94 of Apr 15) will handle **most** Perl constructs
> correctly. What remains is to add 
> 
>         a) s{}() filter (different matching parenths on `s' and `tr');
>         b) $blah'foo filter
> 
> and 99.999% of Perl code is going to be covered.

Does it handle here documents correctly, or does it try to indent them?

Chipmunk


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

Date: Sat, 26 Apr 1997 08:20:26 -0700
From: Roger Smith <rsmith@proteus.arc.nasa.gov>
Subject: Re: undump revisited?
Message-Id: <33621D3A.6FF2@proteus.arc.nasa.gov>

Tom Christiansen wrote:
> 
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc,
>     Roger Smith <rsmith@proteus.arc.nasa.gov> writes:
> :Hi All
> :
> :I am looking for a good way to distribute a highly secure set of perl
> :modules to over 3000 sites. Obviously, sending source code in the clear
> :with embedded passwords, etc., is not the way to do it. There is also no
> :gurantee that every remote site will have the perl interpreter
> :installed.
> 
> Give up.  And I can crack your passwds even if they're in a binary.
> I can get a core dump of the running binary, or use ptrace(), or many
> other things.
> 
> Source code is good for the soul.  If your security model requires
> that source be protected, something's wrong with your model, because
> that's security through obscurity.
> 
> Think of it this way: if all perl programs were distributed in a
> you-can't-see-em fashion, you'd never have learned perl in the
> first place.
> 
> --tom
> --
>         Tom Christiansen        tchrist@jhereg.perl.com
> 
> At MIT the server is the unit of invention.  --Rob Pike

UNCLE!!!!

OK, I holler uncle! Much thanks to the many people who took the time to
respond to my post. Amlost every response commented on my use of the
embedded password issue as an example and so I stand corrected that it
was a bad example to use. I do have passwords in the code but they are
not unix login passwords... Also, I am very aware of 'strings' and
'ptrace' and all the other unix utilities and options for cracking into
binary code.

I am still left with the issue of how to distribute this code to many
unix platforms, and I cant believe that my problem is unique in the
perl/unix world. So here is a more detailed statement of the issue for
those of you that are interested.

About a year ago we wrote a fairly simple client/server model in perl.
The client package gathers statistical information from each client
host, cpu type, memory, disk, etc., and the server collects this
information and stores it in a sybase database. This data is required by
our parent organization for asset management. Perl was originally chosen
as the implimentation language only for the sake of rapid prototying,
and to prove the concept in a working demonstration of capability. The
original intent was that before we go into full production mode, the
code would be rewritten in C, or whatever was appropriate, when and if
the concept was approved. The original perl model was installed on about
100 heterogeneous intra-divisional machines and the demonstration of
capability was much more successful than most. Now we are faced with two
issues. 1. A mandate from our headquarters organization that they want
data collected from all 3000 of our unix boxes yesterday; and 2. The
perl model works SO WELL that it is almost a shame to expend the effort
to rewrite it in another language (but that may be our only option).
However, given NEWLY imposed deadlines for completion there doesn't
appear to be time to rewrite the code, especially considering that our
unix environs are very heterogeneous. We can also guarantee that less
than half of all of our unix boxes will have perl on them. Worse, many
of the unix boxes here are older unix systems with tiny system disks and
so little free space that perl would not fit on many installations.
There is also the obvious security issue of shipping source code around.
People who can gain access to source code would have a much easier time
of making devious modifications for whatever reasons.

My objective for this post is the explore the implementation issue. I
realize, along with most readers, that there are obviously enormous
distribution problems to be dealt with as well, but that is another
subject. Lastly, the above abstract is a gross simplification of a very
complex issue (If the guys from Lewis Research Center are reading this
they are probably rolling on the floor by now :-).

The -u switch and the undump program are one of several options we are
exploring. I confess that I am a little dissappointed that not one
response to the original post gave encouragement for this option, but
then again thats what these forums are all about and if undump is a bad
choice that answer is more valuable than missplaced encouragement. 

I should also mention that any really good solution has the potential
for being adapted Agency wide, which encompasses something in the area
of 10,000 unix systems throughout our WAN.

Best Regards,

Roger Smith
NASA-Ames Research Center
Mountain View, Calif


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

Date: 26 Apr 1997 17:02:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: undump revisited?
Message-Id: <5jtcfr$aam$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Roger Smith <rsmith@proteus.arc.nasa.gov> writes:
:There is also the obvious security issue of shipping source code around.

Still hung up on security through obscurity, eh?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    ": fighting for peace is like fucking for virginity (ado@bigcomm.gun.de)
    Yes, but I did manage to increase the amount of virginity in the world
    by that method." --Larry Wall


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

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

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