[6725] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 350 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 23 03:07:11 1997

Date: Wed, 23 Apr 97 00:00:31 -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 Apr 1997     Volume: 8 Number: 350

Today's topics:
     a question about the Location header <brian@videogamelinks.com>
     Re: a question about the Location header <eryq@enteract.com>
     Re: check command line options? (Nathan V. Patwardhan)
     deleting the current element from a list (Bob Shair)
     Designed vs. Jes' Grew [was: Ousterhout and Tcl lost th <sdm7g@virginia.edu>
     Designed vs. Jes' Grew [was: Ousterhout and Tcl lost th <sdm7g@virginia.edu>
     Get Chars up to first | without splitting <christop@ozinter.co.jp>
     Re: Getting image size (I R A Aggie)
     Re: Last item in list is screwed (Honza Pazdziora)
     Re: Multiple Page Forms????? (jp)
     Newbie Help - Format an Integer with Comma's <deepak@pcsltd.com>
     Re: Newbie Help - Format an Integer with Comma's <ajohnson@gpu.srv.ualberta.ca>
     Re: Perl as its own metalanguage? (The Man on the Scene)
     Re: perl NOT enabled???? win95 - MS server... Please he (I R A Aggie)
     Re: POD Question: Self Documenting Programs Not Support <ajohnson@gpu.srv.ualberta.ca>
     Re: Regular Expression Help Newbie (Tim Gim Yee)
     Re: Regular Expression Help Newbie (Brooks Davis)
     Re: Web/database interface (Paul Tyson)
     Re: What does "UNIX" stand for.. rand@removethis.netjava.com
     Re: why cant I access/print a list-of-lists this way (Tim Gim Yee)
     wretched C++ (Was: Ousterhout and Tcl lost the plot wit <thant@nospam.acm.org>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 22 Apr 1997 23:03:33 +0100
From: Brian Sexton <brian@videogamelinks.com>
Subject: a question about the Location header
Message-Id: <335D359D.7444@videogamelinks.com>

Is it possible for a Location header to force a web browser to load a
new copy of the indicated URL instead of a cached one? Alternately,
might there be a way to direct a browser to simply not cache a
particular page in the first place?

Please reply to brian@videogamelinks.com (I don't usually read this news
group).  Thanks!


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

Date: Wed, 23 Apr 1997 01:33:14 -0500
From: Eryq <eryq@enteract.com>
Subject: Re: a question about the Location header
Message-Id: <335DAD2A.1FCBAF7F@enteract.com>


Brian Sexton wrote:
> 
> Is it possible for a Location header to force a web browser to load a
> new copy of the indicated URL instead of a cached one? Alternately,
> might there be a way to direct a browser to simply not cache a
> particular page in the first place?
> 
> Please reply to brian@videogamelinks.com (I don't usually read this news
> group).  Thanks!

Brian, if you're reading... the answer is to post your question to
comp.infosystems.www.authoring.cgi (and you'll probably want to
read the FAQ first).  

Hope that helps, 
-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.enteract.com/~eryq
 \___||_|  \__, |\__, |___/\  Visit STREETWISE, Chicago's newspaper by/
           |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: 23 Apr 1997 03:03:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: check command line options?
Message-Id: <5jju5r$bad@fridge-nf0.shore.net>

Jason Yutao Li (jyli@PROBLEM_WITH_INEWS_GATEWAY_FILE) wrote:

: I am writting a Perl script which has an -device option. It allows
: users to specify their own tape device name if different than
: the default name:

: How does one trap command-line-option typos ?

Personally, I'm fond of the Getopt modules, which might help you out,
particularly Getopt::Long, where incorrect command-line arguments won't
be acceptable.  See the manpages for Getopt::Long usage.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 23 Apr 1997 02:44:13 GMT
From: rmshair@uiuc.edu (Bob Shair)
Subject: deleting the current element from a list
Message-Id: <5jjt1t$c3l@vixen.cso.uiuc.edu>

Is there an elegant (or just good) way to delete the current element 
from a list when in a foreach loop?

I'm merrily foreaching through a list, using
   foreach $MCD (grep(/00000MCD/,@nontriv)) {
   if ($pages{$LCD} == $pages{$MCD}+1)     {

at that point, I want to delete $MCD from the @nontriv list.

The difficulty I'm having is that I don't know WHERE in the list I am.

TIA,
-- 
Bob Shair                          Open Systems Consultant
1018 W. Springfield Avenue         rmshair@uiuc.edu
Champaign, IL 61821		   217/356-2684
< Not employed by or representing the University of Illinois >


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

Date: Wed, 23 Apr 1997 06:20:24 GMT
From: "Steven D. Majewski" <sdm7g@virginia.edu>
Subject: Designed vs. Jes' Grew [was: Ousterhout and Tcl lost the plot with  latest paper]
Message-Id: <AF832279-16B9A1@128.143.7.189>

On Tue, Apr 22, 1997 3:29 AM, Henry Baker <mailto:hbaker@netcom.com> wrote:
>In article <5jgodk$nd7$1@news.utdallas.edu>, mharriso@utdallas.edu (Mark A
>Harrison) wrote:
>
>> Why are so many of the popular languages created not by language
>> theorists but by people trying to accomplish some other task?
>> 
>> (I think JO raised this last point in his MIT lecture.)
>
>I'll take a shot at this one.
>
>Most 'popular' languages started life as highly specialized (i.e.,
'limited
>scope') languages that had access to some peculiar library -- e.g.,
graphics,
>type-setting, wimp, linear algebra (matlab), symbolic algebra (macsyma,
etc.).
>People then found out that any language with sufficient power (i.e., not
>brain dead) was Turing complete, and the converts to these new languages
>then discovered that they would do _more_ than 'just' graphics,
type-setting,
>etc., etc. 

[ ... ]


Another binary classification of computer languages is 'academic languages'
vs. 'toolkit languages' : 
   Academic languages are typically developed to prove or demonstrate
  something. 
  Toolkit languages are invented to help someone get some work done. 
 
Of course this is a very fluid boundary.

  Academic languages that survive long enough tend to become tools:

     Fortran was written both as a tool, and to prove that the whole idea
      of automatic compilation of an algebraic language was practical (
There
      were quite a few sceptics at the time. ) 

    Smalltalk was written to demonstrate the advantages of a form of
      purely object oriented programming, but it's become a tool for
      business computing. 

   But I think it's reasonable to say that Scheme, ML and Haskell --
good picks for archetypal academic languages --  were all developed to 
demonstrate the wide utility of a few powerful concepts.  ( Maybe I 
should include N.Wirth's creations here: Pascal, Modula-2, et.al. - but
I've never been quite exactly sure what he was trying to prove. )

   Lisp, on the other hand, was one of the original toolkit languages:
It was invented so that John McCarthy and others would have an easier
tool for their AI research. 
   The HOPL-II article on the evolution of Forth, probably the 
archetypal toolkit language describes how Chuck Moore traveled 
around with his card deck, porting Forth to one system after another
as the first step in whatever application he was working on at the time.
   Perl started out as Larry Wall's personal Unix programming toolkit.
The first paper that mentioned Python was about how it was being used
to test network servers for the Amoeba OS project. And Tcl was certainly
designed as a tool.

Another "bi-chotomy" that I've used -- similar but different than the
previous one is:  designed languages vs. "Jes' Grew" languages. 
The thing that characterizes "Jes' Grew" languages is piecemeal growth. 
One of the things I've always  praised about Python is that it's somewhere 
in the golden mean of those two poles. After all, if growth doesn't start
from a good initial design, it quickly turns into a collection of hacks. 
We can admire clever hacks, but sometimes they only postpone the 
inevitable Complete ReWrite. 

Jes' Grew languages tend over time, towards an excess of often
non-productive features and redundancy as they gather layers
of not quite compatible invention. ( CAR, first, head, elt, aref, ... ) 

 I've never doubted the utility of C++, Perl or Tcl as tools, but they 
 all seem limited by their initial design.   To be fair, I've also bumped 
into limitations in Lisp and Python, but they don't seem quite as 
deeply rooted or severe to me. Also, indicating that I see a design 
flaw is not criticism of the designer: In the case of C++, one of the 
design constraints -- that it be compatible with C -- is the source of
most of it's "flaws". Sometimes a tool or language may be very well 
designed given a certain niche or application, but when it's pushed
into other realms, problems appear. ( As Henry Baker noted
above:  there is a tendency for all special purpose languages to grow
towards being more general purpose. ) 


If John Ousterhout is saying that academic comp. sci. has been 
biased against the toolkit languages and the Jes' Grew languages,
and hasn't payed enough attention to practical issues like "glue 
languages", then I agree. However, I think most of us, including
quite a few of the "academics" agree with that notion now.
 It is other issues: distortion of the truth, assertion without evidence,
failing to give credit to, if not his sources, then at least his
predecessors,
that are the cause of the controversy.  I agree strongly with much of
what I took to be the intent of that paper, but I disagree strongly 
with the specific case he makes. As someone else in this thread said:
"It's not even wrong!" 



Henry Baker (again):
>
>The truth is that there isn't more than an ounce of spit in the
differences
>among most of these languages _with the exception of the specialized
>libraries
>that they are hooked up to_, so most of this variation is non-productive.
>

And other source of irritation at that paper is as yet another 
demonstration of the non-productive reinvention of, rather than
learning from, History. And typically, without learning from the
past, it's not any better the second time around. J.O. is claiming 
progress in the fact that we now have something nearly as good 
as we had ten or fifteen years ago. Non productive variation! 


A better guide than Ousterhout is Dick Gabriel.

When I first read his "worse is better" paper, I wasn't sure 
what, if anything, he was advocating.Was he really recommending
"worse" ? I wasn't quite sure -- that paper seemed like a sort of
left handed compliment. 

 His latest book "Patterns of Software" ( mostly collected from
articles from JOOP ) expands on that paper with his notions of
"habitability" -- how to design and plan for systems that will
grow and evolve. I think that's what he was aiming at with that
first paper, and it's what I was aiming at when I first started calling
Python and Perl "Jes' Grew" languages a couple of years ago. 



- Steve Majewski
<sdm7g@Virginia.EDU> 



BTW: The phrase "Jes' Grew" is from Ishmael Reed. I don't 
remember which book. I do almost remember the line:
 "Where did Jazz come from?"
 "No Come From, it Jes Grew!" 

P.S. I hate to see people spread lies and rumors of the "failure"
of Lisp, when lisp has been one of the greatest, most successful 
Jes' Grew Toolkit languages ever. Lisp is going to be aound when
it turns 40.  It's obvious it could use another rewrite. If J.O. had
wasted less time knocking Lisp and spent a bit more time learning
from it, maybe Tcl would not be showing signs of tired old age already. 









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

Date: Wed, 23 Apr 1997 06:20:24 GMT
From: "Steven D. Majewski" <sdm7g@virginia.edu>
To: "Henry Baker" <hbaker@netcom.com>, python-list@cwi.nl
Subject: Designed vs. Jes' Grew [was: Ousterhout and Tcl lost the plot with  latest paper]
Message-Id: <AF832286-16BC7C@128.143.7.189>


On Tue, Apr 22, 1997 3:29 AM, Henry Baker <mailto:hbaker@netcom.com> wrote:
>In article <5jgodk$nd7$1@news.utdallas.edu>, mharriso@utdallas.edu (Mark A
>Harrison) wrote:
>
>> Why are so many of the popular languages created not by language
>> theorists but by people trying to accomplish some other task?
>> 
>> (I think JO raised this last point in his MIT lecture.)
>
>I'll take a shot at this one.
>
>Most 'popular' languages started life as highly specialized (i.e.,
'limited
>scope') languages that had access to some peculiar library -- e.g.,
graphics,
>type-setting, wimp, linear algebra (matlab), symbolic algebra (macsyma,
etc.).
>People then found out that any language with sufficient power (i.e., not
>brain dead) was Turing complete, and the converts to these new languages
>then discovered that they would do _more_ than 'just' graphics,
type-setting,
>etc., etc. 

[ ... ]


Another binary classification of computer languages is 'academic languages'
vs. 'toolkit languages' : 
   Academic languages are typically developed to prove or demonstrate
  something. 
  Toolkit languages are invented to help someone get some work done. 
 
Of course this is a very fluid boundary.

  Academic languages that survive long enough tend to become tools:

     Fortran was written both as a tool, and to prove that the whole idea
      of automatic compilation of an algebraic language was practical (
There
      were quite a few sceptics at the time. ) 

    Smalltalk was written to demonstrate the advantages of a form of
      purely object oriented programming, but it's become a tool for
      business computing. 

   But I think it's reasonable to say that Scheme, ML and Haskell --
good picks for archetypal academic languages --  were all developed to 
demonstrate the wide utility of a few powerful concepts.  ( Maybe I 
should include N.Wirth's creations here: Pascal, Modula-2, et.al. - but
I've never been quite exactly sure what he was trying to prove. )

   Lisp, on the other hand, was one of the original toolkit languages:
It was invented so that John McCarthy and others would have an easier
tool for their AI research. 
   The HOPL-II article on the evolution of Forth, probably the 
archetypal toolkit language describes how Chuck Moore traveled 
around with his card deck, porting Forth to one system after another
as the first step in whatever application he was working on at the time.
   Perl started out as Larry Wall's personal Unix programming toolkit.
The first paper that mentioned Python was about how it was being used
to test network servers for the Amoeba OS project. And Tcl was certainly
designed as a tool.

Another "bi-chotomy" that I've used -- similar but different than the
previous one is:  designed languages vs. "Jes' Grew" languages. 
The thing that characterizes "Jes' Grew" languages is piecemeal growth. 
One of the things I've always  praised about Python is that it's somewhere 
in the golden mean of those two poles. After all, if growth doesn't start
from a good initial design, it quickly turns into a collection of hacks. 
We can admire clever hacks, but sometimes they only postpone the 
inevitable Complete ReWrite. 

Jes' Grew languages tend over time, towards an excess of often
non-productive features and redundancy as they gather layers
of not quite compatible invention. ( CAR, first, head, elt, aref, ... ) 

 I've never doubted the utility of C++, Perl or Tcl as tools, but they 
 all seem limited by their initial design.   To be fair, I've also bumped 
into limitations in Lisp and Python, but they don't seem quite as 
deeply rooted or severe to me. Also, indicating that I see a design 
flaw is not criticism of the designer: In the case of C++, one of the 
design constraints -- that it be compatible with C -- is the source of
most of it's "flaws". Sometimes a tool or language may be very well 
designed given a certain niche or application, but when it's pushed
into other realms, problems appear. ( As Henry Baker noted
above:  there is a tendency for all special purpose languages to grow
towards being more general purpose. ) 


If John Ousterhout is saying that academic comp. sci. has been 
biased against the toolkit languages and the Jes' Grew languages,
and hasn't payed enough attention to practical issues like "glue 
languages", then I agree. However, I think most of us, including
quite a few of the "academics" agree with that notion now.
 It is other issues: distortion of the truth, assertion without evidence,
failing to give credit to, if not his sources, then at least his
predecessors,
that are the cause of the controversy.  I agree strongly with much of
what I took to be the intent of that paper, but I disagree strongly 
with the specific case he makes. As someone else in this thread said:
"It's not even wrong!" 



Henry Baker (again):
>
>The truth is that there isn't more than an ounce of spit in the
differences
>among most of these languages _with the exception of the specialized
>libraries
>that they are hooked up to_, so most of this variation is non-productive.
>

And other source of irritation at that paper is as yet another 
demonstration of the non-productive reinvention of, rather than
learning from, History. And typically, without learning from the
past, it's not any better the second time around. J.O. is claiming 
progress in the fact that we now have something nearly as good 
as we had ten or fifteen years ago. Non productive variation! 


A better guide than Ousterhout is Dick Gabriel.

When I first read his "worse is better" paper, I wasn't sure 
what, if anything, he was advocating.Was he really recommending
"worse" ? I wasn't quite sure -- that paper seemed like a sort of
left handed compliment. 

 His latest book "Patterns of Software" ( mostly collected from
articles from JOOP ) expands on that paper with his notions of
"habitability" -- how to design and plan for systems that will
grow and evolve. I think that's what he was aiming at with that
first paper, and it's what I was aiming at when I first started calling
Python and Perl "Jes' Grew" languages a couple of years ago. 



- Steve Majewski
<sdm7g@Virginia.EDU> 



BTW: The phrase "Jes' Grew" is from Ishmael Reed. I don't 
remember which book. I do almost remember the line:
 "Where did Jazz come from?"
 "No Come From, it Jes Grew!" 

P.S. I hate to see people spread lies and rumors of the "failure"
of Lisp, when lisp has been one of the greatest, most successful 
Jes' Grew Toolkit languages ever. Lisp is going to be aound when
it turns 40.  It's obvious it could use another rewrite. If J.O. had
wasted less time knocking Lisp and spent a bit more time learning
from it, maybe Tcl would not be showing signs of tired old age already. 









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

Date: Wed, 23 Apr 1997 13:06:54 +0900
From: "christop@ozinter.co.jp" <christop@ozinter.co.jp>
Subject: Get Chars up to first | without splitting
Message-Id: <335D8ADE.2E61@ozinter.co.jp>


Hi Hi again..

We're getting further... this is one that strikes me is probably very
nicely done with perl but I can't find an example anywhere to learn from
or pinch.

I've got a text file that contains this -

001|something|something else|and some more

- reading into $line a line at a time and I want to just put the 001 bit
into $FirstBit.


Question:

Can I extract the characters up to the first occurrence of | ? 
Currently I'm splitting the whole line into $FirstBit and the rest into
$junk1,$junk2 etc but this seems a long way round perhaps ?  There could
be any number of characters before the |.

Thank you once again for advice and assistance.. 

Christopher
Tokyo,April97

http://www.wonderlandinorbit.com


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

Date: Tue, 22 Apr 1997 15:17:56 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Getting image size
Message-Id: <fl_aggie-ya02408000R2204971517570001@news.fsu.edu>

In article <335D07B3.81786A50@ozartnet.com.au>, Willem van den Bosch
<willem@ozartnet.com.au> wrote:

[posted && cc'd]

+ Is there anyway of getting the image size in pixels from a gif or jpeg
+ file, using perl. If the answer is yes Please tell me how.

Yes. Try this:

# to get the latest version of wwwimage try either:
#    http://www.dcs.ed.ac.uk/home/ark/wwwimagesize
#    http://www.ugcs.caltech.edu/~werdna/gifsize/

I borrowed their subroutines to determine sizes so that I could
scale to an arbritrary size using the net_pbm package.

James

-- 
Consulting Minster for Consultants, DNRC

To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Wed, 23 Apr 1997 06:22:40 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Last item in list is screwed
Message-Id: <adelton.861776560@aisa.fi.muni.cz>


Marcus Nordenstam <mnordenstam@imagicgames.com> writes:

> Why is it that when I write:
> 
> @list = ("a\n","b\n");
> 
> the expression 
> 
> while( $l = <@list> )
> {
>   print $l;  
> } 
> 
> evaluates to:
> 
> a<CR>
> b
> 
> when it ought to be:
> 
> a<CR>
> b<CR>
> 
> where <CR> is a carriage return, or newline.
> 
> It seems like the last item in the list has it's newline
> removed, which is silly.  It means that you can't treat
> each list element the same, you have to check for the last
> item and special-case it.
> 
> Or is there perhaps some way to disable this "feature"??

The first thing, do not mix up reading from the file with accessing
elements of an array. What you probably want instead ( $l = <@list> )
is

for $l (@list)
	{ ...

which will loop over all elements in the array @list. I am not too
sure what your expression means but it certainly is not correct ;-)

If you will do this change, it will set $l to elements in @list and
everything will be fine.

Hope this helps.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Wed, 23 Apr 1997 01:39:59 GMT
From: jp@here.com (jp)
Subject: Re: Multiple Page Forms?????
Message-Id: <33606829.38660910@news.cent.com>

You know what mistake you made. If he thought he could do it another
way he would not ask about perl, unless he needed to know about perl.
You attempted to chastise him and stated that it was not a perl
question when it fact it was.  

It might not be about modules, but then you did not say that.

You were just unfriendly. The spirit of the Internet is to help.

And now you want to embarress me in public ? no fool you ?

If you don't like it, do something to change the name to
comp.modules.perl (if you know what that means)


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

Date: Wed, 23 Apr 1997 01:04:59 -0400
From: Deepak Thadani <deepak@pcsltd.com>
Subject: Newbie Help - Format an Integer with Comma's
Message-Id: <335D987B.22AF@pcsltd.com>

Hello,
	I'm sorry to ask such a question, but I can't really
figure this out.  Is there some kind of format command in perl
which places commas in between numbers for me?  Say I had a 
variable $VALUE with a value of 1024000.  Is there a function
or something I could use to get $VALSTR to be "1,024,000" ?
Something more ledgible, something with commas. How?

Thanks again all.

Deepak <deepak@pcsltd.com>


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

Date: Wed, 23 Apr 1997 01:15:34 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Newbie Help - Format an Integer with Comma's
Message-Id: <335DA906.5E7A64C@gpu.srv.ualberta.ca>

Deepak Thadani wrote:
> 
> Hello,
>         I'm sorry to ask such a question, but I can't really
> figure this out.  Is there some kind of format command in perl
> which places commas in between numbers for me?  Say I had a
> variable $VALUE with a value of 1024000.  Is there a function
> or something I could use to get $VALSTR to be "1,024,000" ?
> Something more ledgible, something with commas. How?
> 
> Thanks again all.
> 
> Deepak <deepak@pcsltd.com>


there is a FAQ answer for this which will do what
you want.

However,the following, I've been told, will be added to the
FAQ as an alternate solution---it will comma-fy all the
numbers in a string regardless of whether there are decimal
portions, or leading +'s or -'s or other characters in front
of the number (like $12000.00 or something) so that:

$string='12345.12345 or 1.4321 or $1500.00 or -1024000';

$string=reverse $string;
$string=~s<(\d\d\d)(?=\d)(?!\d*\.)><$1,>g;
$string=reverse $string;

print $string;

comes out as:

12,345.12345 or 1.4321 or $1,500.00 or -1,024,000

if your string consists of only an integer, you might
want to check the FAQ solution; the above can be handy for
quickly comma-fying long strings with many values, such as a
long list of prices, before spitting them out in a table or
something.

working on a reversed string can sometimes simplify
regular expression patterns for other problems too.

regards
andrew


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

Date: 23 Apr 1997 01:23:34 GMT
From: shaug@callamer.com (The Man on the Scene)
Subject: Re: Perl as its own metalanguage?
Message-Id: <5jjoam$bsb$1@zinger.callamer.com>

In article <335CC591.7FD6@dra.com>,
	Michael Iles <michaeli@dra.com> writes:
> Tom Christiansen wrote:
>> There is no such thing as a "hash context", and an "array context"
>> is just a quaint way of saying "list context".  So there are only
>> two contexts, singular and plural.  C shares this.
> 
> Can you elaborate on this? In C++, at least, you can't overload based on
> return type. I'm having trouble thinking of a construct in C that would
> act differently based on a 'singular' or 'plural' context.
> 
> Mike.
> 
 
 Would a C array vs. non-array count as plural vs. singular, respectively?
 From my understanding, you can only have a limited set of types in C,
 generally speaking:  built-in types (int, float, char, struct, union, 
 pointer, etc), typedef'd types, pointers to a value of a given type, or 
 arrays of a given type.  So, I can see how arrays would be called "plural",
 but what about structs or unions?

 For that matter, how would you precisely define a "plural type"?
 (I 'spose this question invalidates the first paragraph -- so sue me.)
 
-- 
O'Shaughnessy Evans
UNIX/Internet Systems Administrator, GST-Call America; SLO, CA
mailto: shaug@callamer.com; http://gromit.callamer.com


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

Date: Tue, 22 Apr 1997 16:06:57 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: perl NOT enabled???? win95 - MS server... Please help
Message-Id: <fl_aggie-ya02408000R2204971606580001@news.fsu.edu>

In article <5jj0u3$rgr@info.abdn.ac.uk>, dev.null wrote:

+ Jody of Webmaster@urdls.com wrote in comp.lang.perl.misc:
+ : I'm trying to get a simple search engine to work with a dynamic IP
server (mine)
+ : Is there a program I have to install in the cgi-bin/scripts folder?
+ 
+ perl.exe :)

I wouldn't put the interpreter in the cgi-bin/ tree...

James

-- 
Consulting Minster for Consultants, DNRC

To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Tue, 22 Apr 1997 22:11:05 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: POD Question: Self Documenting Programs Not Supported?
Message-Id: <335D7DC9.4F9FA3EA@gpu.srv.ualberta.ca>


! I'm trying to use POD to do document my Perl programs.  I
! can use pod2text (for example) to get all of the
! documentation from the program, but what I *really* want is
! the source code and the documentation to come out
! interleaved like this:

[snip example]

! (Admittedly, the text version is hard to read, but the HTML
! version should be much nicer.) Any ideas?

personally, I find POD best suited for embedding
man-pages in the scripts---for source code documentation
I use the 'noweb' , a tool for literate programming that
is language independent and is extensible.

it can use TeX, LaTeX, or HTML as the documentation
formatting language, and it has a latex2html filter
so you can write for LaTeX and still produce html
documentation.

It doesn't pretty print the code iteself---rather it
typesets it in a type of verbatim environment---but
it preserves all spacing and indentation when it
produces typset documentation or extracts (tangles) out
the code. I prefer this method, as I like my code to
look just like code not a typeset representation of code.

It can work with multiple files, and beyond producing nice
interleaved code and documentation, it also provides
indexing and cross-referencing of code chunks and of
manually defined identifiers---being extensible, I have made
a simple autodefs filter to automatically recognize and
index perl package and subroutine names and then I manually
define identifiers such as global variables and any others I
feel warrant indexing.

It has been ported to several platforms and
you can check out the noweb homepage at:

http://www.cs.virginia.edu/~nr/noweb

regards
andrew


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

Date: Wed, 23 Apr 1997 04:22:35 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: Regular Expression Help Newbie
Message-Id: <335d8240.60511170@news.seanet.com>

On Tue, 22 Apr 1997 21:27:21 -0400, Deepak Thadani <deepak@pcsltd.com>
wrote:

>Hello,
>	I have a perl script in which
>$_ = "881     /usr/spool/mmdf/lock/home"
>
>What I want to do is get the number (in this case 881) into a variable
>called $VALUE.  This is what I've got, which only seems to return
>the 1.
>
>$VALUE = /[0-9]*\S\//;
>
>What I believe the above is doing is getting all the numbers until
>I get to a white space or / right?  Apparently wrong since $VALUE
>after running that line, is simply 1.

Let's see what your expression is doing...

$VALUE =      # Assign the result of matching pattern,
              #   which will be either true (simply 1) or false.
  /           # Match
    [0-9]*    # zero or more digits,
    \S        # followed by a single non-space character,
    \/        # followed by a forward slash.
  /;

I think you matched 'r/' in $_ so it evaluated to 'true'.  This is
closer to what you're looking for:

($VALUE) = m!^(\d+)\s*/!;

or

($VALUE) =    # List context will assign $1 to $VALUE.
  m!          # Start match.  No need to backslash forward slash.
	^         # Assertion matching only at beginning of string.
	(\d+)     # Save one or more digits into $1.
	\s*       # Match zero or more whitespace.
	/         # Match the forward slash.
  !x;         # End match.  Allow extended RE.

>
>Please help...and explain how I can figure out reg exp's better if 
>possible.  Thanks a lot.

Perl comes with tons of documentation.  Try perlre and perlop.


-- Tim Gim Yee             tgy@chocobo.org
http://www.dragonfire.net/~tgy/moogle.html
"Will hack perl for a moogle stuffy, kupo!"


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

Date: 23 Apr 1997 04:45:51 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: Regular Expression Help Newbie
Message-Id: <5jk45v$82$1@cinenews.claremont.edu>

Deepak Thadani (deepak@pcsltd.com) wrote:
: 	I have a perl script in which
: $_ = "881     /usr/spool/mmdf/lock/home"
: 
: What I want to do is get the number (in this case 881) into a variable
: called $VALUE.  This is what I've got, which only seems to return
: the 1.
: 
: $VALUE = /[0-9]*\S\//;
: 
: What I believe the above is doing is getting all the numbers until
: I get to a white space or / right?  Apparently wrong since $VALUE
: after running that line, is simply 1.

Ok, you've got a couple of problem here.  First, /REGEXP/ returns a
1 or 0 depending on wherther $_ contains a string which can be matched by
REXEXP.  Second, the regexp '[0-9]*\S\/' dosen't match what you think it
matches.  In your example it matches "r/" because \S matches
non-whitespace and [0-9]* doesn't have to match anything.  I think the
regexp you really ment to write (this is still wrong though) was
'^[0-9]+\s*\/' which will match numbers at the beginning of the line followed
by whitespace which is followed by a '/'.

Now, to do it right, you have a couple of options.

/([0-9]+)\s*\//;
$VALUE = $1;

That should do it, but a more robust method would be:

if( /^(\d+)\s*\// ) {
  $VALUE = $1;
} else {
  $VALUE = -1; # assign an obviously bogus value
}

That does what you say you want, but your input looks like the output of
du which dosen't have to use paths with /'s at the beginning.  Thus you
probably just want:

if( /^(\d+)/ ) { # match the number at the beginning of the line
  $VALUE = $1;   # assign it to $VALUE
} else {
  $VALUE = -1;   # assign an obviously bogus value if the match failed
}

-- Brooks

--
Brooks Davis            +------------------------------------------------+
brdavis@hmc.edu         | "_Slackware_ [Linux] is the MacOS of UNIXes."  |
Harvey Mudd College     |                    -- Richard Garnish          |
340 E. Foothill Blvd.   |                       on alt.sysadmin.recovery |
Claremont, CA 91711     +------------------------------------------------+


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

Date: 22 Apr 1997 22:21:43 -0500
From: ptyso@southwind.net (Paul Tyson)
Subject: Re: Web/database interface
Message-Id: <m2n2qqjuev.fsf@southwind.net>

>>>>> "Michael" == Michael Meuser <meuser@cats.ucsc.edu> writes:

    Michael> Hello - I will be developing a web interface to query an
    Michael> MS SQL server v.6.5, I'm wondering if any of you have had
    Michael> experience doing this with perl, what tools you used,
    Michael> problems, solutions, and why you chose Perl over, say,
    Michael> java?  Any help appreciated.

    Michael> Mike Meuser

I've found the Win32::ODBC package quick and easy.  It does more SQL
than I know, which is enough to get the job done.  Our web server is
on an NT 3.51 machine, SQL Server 6.5 is on an NT 4.0 machine.

We used perl because it was close at hand and it appeared to be
versatile and easy to learn.

Look for Win32::ODBC on CPAN, under other Windows stuff.

Good luck,
Paul Tyson


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

Date: Tue, 22 Apr 1997 10:55:56 GMT
From: rand@removethis.netjava.com
Subject: Re: What does "UNIX" stand for..
Message-Id: <5jjrke$ehb$1@news.compuex.com>

Ron Natalie <ron@sensor.com> wrote:

>Douglas Seay wrote:

>> And if I remember my folklore correctly, they only had 64K segments to
>> work with.  I've surely never used a PDP-7, so I can't say for sure.

>Other than the size issues, CPP is syntactically easier to implement
>as a separate pass, frankly I think it was an afterthought to the C
>language.

>-Ron

As best I remember from the old Bell Labs Notes, the preprocessor was
separate because it was originally used with the assembler, then
pressed into service with C. 
rand mcnatt (rand@REMOVETHISnetjava.com)



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

Date: Wed, 23 Apr 1997 04:35:30 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: why cant I access/print a list-of-lists this way
Message-Id: <335d8fd7.63989742@news.seanet.com>

On 22 Apr 1997 14:20:54 -0700, brannon@bufo.usc.edu (Terrence M.
Brannon) wrote:

>@vilist = ( [ $p, $s ] , [ $p, $s ] , [ $s , $p ] , [ $s , $p ] );
>@ivlist = (0,1,0,1);
>
>foreach $vi (@vilist) {
>    foreach $invariant_value (@ivlist) {
>	print "=" x 50;
>	print "\n";
>	$variant   = $vi[0]; # <--- this line
>	$invariant = $vi[1]; # <--- and this line both fail

Each $vi from @vilist is an array reference.  You need to dereference
it first.  Perhaps...
	my @tmp = @$vi;
	$variant = $tmp[0];
	$invariant = $tmp[1];

>	$filename="$invariant" . "=" . "$invariant_value";

or $filename = $invariant . '=' . $invariant_value;
or $filename = "$invariant=$invariant_value";

>	print $filename, $/;
>
>    }
>}


-- Tim Gim Yee             tgy@chocobo.org
http://www.dragonfire.net/~tgy/moogle.html
"Will hack perl for a moogle stuffy, kupo!"


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

Date: Tue, 22 Apr 1997 20:38:17 -0700
From: Thant Tessman <thant@nospam.acm.org>
Subject: wretched C++ (Was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <335D8429.41C6@nospam.acm.org>

I wrote:

[...wretched C++...]

If what I wrote sounds harsh, let me explain what I had just spent
the previous two hours doing.

I had this:

	struct A { /* ... */ }

	template <class T>
	struct B : A { /* ... */ }

I wanted to do this:

	A* a = new B<whatever>;

	B<whatever>* b = dynamic_cast<B<whatever>*>(a);

I managed to figure out that in order for this to work, it's 
not enough that the compiler see the entire definition of B<T>, 
but it also needs to see B<whatever> explicitly instantiated.  
According to the ANSI C++ proposal, this is done like so:

	template class B<whatever>;

But of course the compiler I'm using doesn't support this yet.
(IRIX 6.2 C++ 7.1) so you have to do this instead:

	#pragma instantiate B<whatever>

There were no warnings, and no clues about what I was doing 
wrong.  dynamic_cast just consistently returned zero.

C++ is *full* of bullshit like this and I've spent way too
much of my life fighting it.

-thant


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

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

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