[7878] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1503 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 18 22:07:23 1997

Date: Thu, 18 Dec 97 19:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 18 Dec 1997     Volume: 8 Number: 1503

Today's topics:
     Re: 6 elementary questions <rjk@coos.dartmouth.edu>
     Re: Adding user to NT domain <dhinkle@cisco.com>
     Any problems with processes under WinNT 4.0 (David J. Boyd)
     Re: Evaluate blank text? <blakem@seas.upenn.edu>
     Re: Evaluate blank text? <rjk@coos.dartmouth.edu>
     Re: File Creation on Server from Perl Script <rootbeer@teleport.com>
     Forcing list context (Peter Scott)
     FREE smut!  No cost at all!  Thousands of FREE pix. tfarrell@miworld.com
     Gethostbyname??? (James Dornan)
     Re: Help - opendir() <rootbeer@teleport.com>
     Re: How do I create NDBM file from a flat file? <bruce.albrecht@seag.fingerhut.com>
     Re: Iteration within a foreach loop <rjk@coos.dartmouth.edu>
     Re: mysterious "Missing $ on loop variable" error <ajohnson@gpu.srv.ualberta.ca>
     Re: mysterious "Missing $ on loop variable" error <rootbeer@teleport.com>
     Re: Newbie can't add the -w flag to perl to get useful  <rhodri@wildebst.demon.co.uk>
     Re: Newbie Pattern Matching question (Gabor)
     Re: No Flock! -- Now What? <rootbeer@teleport.com>
     Re: pgp encrypion via perl script (brian d foy)
     Re: Q: limiting the input array size <rootbeer@teleport.com>
     Re: Script calls embedded in web pages (Martien Verbruggen)
     Re: Sending a signal to a process owned by someone else <rootbeer@teleport.com>
     Re: Teaching programing geldridg@progsoc.uts.edu.au
     What is wrong with this script? guardian@ok.azalea.net
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 18 Dec 1997 20:23:38 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: 6 elementary questions
Message-Id: <3499CC9A.A6F35C@coos.dartmouth.edu>

? the platypus {aka David Formosa} wrote:
> 
> >(split(m@/@, (split(m@ @, $str))[2]))[-1]
> 
> It dosn't?  As far as I can tell it workes. However as perl counts from
> zero it should be [1] rather then two.  Alos this will not work in a
> print stament for some unfathanable reson.  If you whant it to work in a
> print stamennt you will have to put a set of brackes around it.

It seems perfectly fathomable to me.

~> perl -w
print (split(m@/@, (split(m@ @, $str))[2]))[-1]


print (...) interpreted as function at - line 1.
Can't use subscript on print at - line 1, near "1]"
Execution of - aborted due to compilation errors.

If the argument list to print begins with (, print is interpreted as a function
rather than a list operator, which means only the contents of () are arguments
to print.

This would work better:

print +(split(m@/@, (split(m@ @, $str))[2]))[-1]


Chipmunk


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

Date: Thu, 18 Dec 1997 18:15:48 -0800
From: "Daniel Hinkle" <dhinkle@cisco.com>
Subject: Re: Adding user to NT domain
Message-Id: <67cl1n$ed3$1@news-sj-3.cisco.com>

I don't know how to do this using addusers.exe, but if you don't use
addusers and use the NetAdmin module that comes with the activewear port of
perl it doesn't require the user to change their password.

Daniel


The next problem is probably a NT problem, not a perl problem, but perhaps
>anyone can tell me how I can resolve this in perl. When I create a user
>using the perl script, the user has to change his password at the next
>logon. I don't want this. I can't find any command for this.





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

Date: Fri, 19 Dec 1997 00:25:23 GMT
From: djboyd@nospam.sam.on-net.net (David J. Boyd)
Subject: Any problems with processes under WinNT 4.0
Message-Id: <3499be49.39014641@news.on-net.net>

I am running WinNT 4.0 with Perl 5.  I was wondering if there is anything I
sould know about when creating processes and how the interact with each other.
Currently, I have a driver.pl which creates 6 processes.  Then each of these
processes kick off another process each.
To reply, remove nospam from the address: djboyd@sam.on-net.net


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

Date: 19 Dec 1997 02:03:47 GMT
From: "Blake D. Mills IV" <blakem@seas.upenn.edu>
Subject: Re: Evaluate blank text?
Message-Id: <67ckm3$5a1$1@netnews.upenn.edu>

FeckMan <feckman@albany.net> wrote:
: if ($firstname eq '') {&incomplete1}
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

That one looks good... though there are some more readable ways to write it...

   unless ($firstname) {&incomplete1}
   if (not $firstname) {&incomplete1}
   unless (defined($firstname)) {&incomplete1};

Should all be essentially equivalent to the underlined line above.

They fail to do what you want if $firstname consists
solely of whitespace though.  You might try:

   if ($firstname =~ /^\s*$/) {&incomplete1}

to catch whitespace-only submissions.

-Blake




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

Date: Thu, 18 Dec 1997 21:28:38 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: "Blake D. Mills IV" <blakem@seas.upenn.edu>
Subject: Re: Evaluate blank text?
Message-Id: <3499DBD6.6389067E@coos.dartmouth.edu>

Blake D. Mills IV wrote:
> 
> FeckMan <feckman@albany.net> wrote:
> : if ($firstname eq '') {&incomplete1}
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> That one looks good... though there are some more readable ways to write it...
> 
>    unless ($firstname) {&incomplete1}
>    if (not $firstname) {&incomplete1}
>    unless (defined($firstname)) {&incomplete1};
> 
> Should all be essentially equivalent to the underlined line above.

They're not.  In fact, none of the three conditionals are equivalent.

($firstname eq '')            true if $firstname is: undefined, ''
(not $firstname)              true if $firstname is: undefined, '', 0
(not defined($firstname))     true if $firstname is: undefined

In particular, only the first one is likely to be correct for the
original posters needs, to detect blank input in a form.

Chipmunk


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

Date: Thu, 18 Dec 1997 17:43:27 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Henry Wolff <admin@hatsoft.com>
Subject: Re: File Creation on Server from Perl Script
Message-Id: <Pine.GSO.3.96.971218174216.23295J-100000@user2.teleport.com>

On Thu, 18 Dec 1997, Henry Wolff wrote:

> So the question is, how can I check if a file is on the server, 

If your program is running on the server, use Perl's filetest operators,
such as -f.

> create it if it not,

Use open.

> and then set the permissions?

Use chmod, or umask.

Check the perlfunc and perlop manpages for more information. Hope this
helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 19 Dec 1997 01:34:39 GMT
From: psb@euclid.jpl.nasa.gov (Peter Scott)
Subject: Forcing list context
Message-Id: <67civf$e64@netline.jpl.nasa.gov>

Okay, suppose you have a string you want to count the number of
occurrences of a substring in, e.g., you want to find out how many
"foo" there are in $s = "foofooraw for foodies".  Now $s =~ /foo/g
will return a list of them, and we just want the size of the list;
but doing $x = ($s =~ /foo/g) causes the /g modifier to be evaluated
in scalar context (so it doesn't do any good to put "scalar" in there),
and so it looks like one has to do my @a = ($s =~ /foo/g); my $x = @a;

It just rankles to name and create a new variable for this purpose;
the laziness virtue in me thinks there has to be a way to do without.
Is there?  What am I missing?

-- 
This is news.  This is your      |  Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?   |  (psb@euclid.jpl.nasa.gov)

(Temporary email address: will be dumped when first spam arrives.)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


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

Date: Thu, 18 Dec 1997 18:32:43 -0700
From: tfarrell@miworld.com
Subject: FREE smut!  No cost at all!  Thousands of FREE pix.
Message-Id: <181297183243@miworld.com>

We have a FREE gallery on http://www.xxxgirlfriend.com!! We are adding to our pile of pixs all the time and you are the one who benefits. 

Just cut and paste this url "http://www.xxxgirlfriend.com" and you'll be at a totally FREE Picture archive. There are plenty of tasty little dishes to choose from. Just click on the "Get Another Pic"button and our server will feed you Babe after Babe until you decide to quit. Bookmark our site because you'll want to cum back often! 

Each time you visit you will be able to get even MORE free pix!

Enjoy!!

xxxgirlfriend Administrator






<==>=>=>>><==>>>==>>


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

Date: 19 Dec 1997 01:27:21 GMT
From: james@zaire.hooked.net (James Dornan)
Subject: Gethostbyname???
Message-Id: <67cihp$mqn$1@its.hooked.net>

I tried this little test of gethostbyname on BSD OS 3.0 and Linux 2.1.45
and got the same result every single time. I was expecting an address,
but insted I got a few control characters. Could someone please explain.

Script --

#!/usr/bin/perl

($name,$aliases,$addrtype,$length,@addrs)=gethostbyname("www.wenet.com");

ping "@addrs\n";




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

Date: Thu, 18 Dec 1997 17:48:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help - opendir()
Message-Id: <Pine.GSO.3.96.971218174718.23295K-100000@user2.teleport.com>

On Thu, 18 Dec 1997, David J. Boyd wrote:

> I am trying to find out if opendir has a time out period with it.   

If it does, your system imposed it. (Perl doesn't put one in.) So you may
need to check with your system's docs.

> To reply, remove nospam from the address: djboyd@sam.on-net.net

To get email to bounce, add nospam to the address: rootbeer@teleport.com

:-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 18 Dec 1997 17:10:40 -0600
From: Bruce Albrecht <bruce.albrecht@seag.fingerhut.com>
Subject: Re: How do I create NDBM file from a flat file?
Message-Id: <gdzply8cy7.fsf@seag.fingerhut.com>

"Bruno Prior" <bruno@prior.ftech.co.uk> writes:

> Chris Lee <chrislee@med.unc.edu> wrote in article
> <349941C7.E397C1C@med.unc.edu>...
> > Howdy All,
> > 
> > I'm running into problems in creating a NDBM file from a flat file
> >
> > (snipped)
> >
> > for (@foo) { $bar .= $_;}
> 
> That should be a "foreach", not a "for". Same applies to the following
> occurence.

>From the Camel book (2nd ed.), page 100:

The <foreach> keyword is actually a synonym for the <for> keyword, so you
can use <foreach> for readability or <for> for brevity.




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

Date: Thu, 18 Dec 1997 20:39:21 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: paul@pmcg.com
Subject: Re: Iteration within a foreach loop
Message-Id: <3499D049.F86AAB05@coos.dartmouth.edu>

Paul wrote:
> 
>         foreach $domname (sort keys %prifor) {
>                 @buf = split /\n/, `whois $domname`;
> 
>                 foreach ( @buf ) {
>                         if ( /$match_this_puppy/ ) {
>                                 <ITERATE TWO MORE LINES HERE>;
>                                 ...do somethig way cool here;
>                         }
>                 }
>         }
> 
>         Any clues for the clueless?

Use a for loop instead of a foreach loop.

for ($i=0; $i<=$#buf; ++$i) {
  if ($buf[$i] =~ /$match_this_puppy/) {
    $i+=2;
  }
}

Chipmunk


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

Date: Thu, 18 Dec 1997 18:33:05 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: mysterious "Missing $ on loop variable" error
Message-Id: <3499C0C1.3806DD02@gpu.srv.ualberta.ca>

web@calarts.edu wrote:
!
! I wanted to write a general-purpose subroutine for searching
! through a hash for a string, so I wrote:
!
! sub FindString {
!         my $string = shift;
!         my $hashref = shift;
!         my @return;
!         foreach my $key ( keys %{$hashref} ) {
!                 if ( $hashref->{$key} =~ m|$string| ) {
!                         push(@return, $key);
!                 }
!         }
!         return @return;
! }
! 
! But whenever I try to compile this I get the error "Missing $ on
! loop variable". The compiler seems to be complaining about the
[snip]

are you sure you are using perl5.004 or later? try
perl -V
I don't believe using my on a control loop was allowed until 5.004

regards
andrew


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

Date: Thu, 18 Dec 1997 17:39:18 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: I R A Aggie <fl_aggie@thepentagon.com>
Subject: Re: mysterious "Missing $ on loop variable" error
Message-Id: <Pine.GSO.3.96.971218173829.23295H-100000@user2.teleport.com>

On Thu, 18 Dec 1997, I R A Aggie wrote:

> In article <882480075.86704138@dejanews.com>, web@calarts.edu wrote:
> 
> +         foreach my $key ( keys %{$hashref} ) {

> Earlier versions of perl 5 (pre-v5.004, I think) seem to object to the
> 'my $variable' syntax in a foreach loop.

I thought he had just forgotten to pay the variable tax. :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 18 Dec 1997 23:03:12 +0000 (GMT)
From: Rhodri James <rhodri@wildebst.demon.co.uk>
Subject: Re: Newbie can't add the -w flag to perl to get useful warnings
Message-Id: <47faa07af0rhodri@wildebst.demon.co.uk>

In article <daveSTOP*SPAMreed-1812971048260001@d200.b70.cmb.ma.ultra.net>,
 Dave Reed <daveSTOP*SPAMreed@webshowplace.com> wrote:
> I've been told to "add the -w flag to perl to get useful warnings."

> Not having the slightest idea how to do that, I turned to LEARNING PERL
by
> Schwartz & Christiansen, only to be told to "turn on the -w option from
> the command line, which you should always do for safety's sake."

> How?  Type "perl -w" before the filename, like when using "perl -c"?

Yes.

> Everyone seems to assume that Perl newbies are already programmers.

No, actually, they just assume that Perl newbies are Unix users :-(  "The
-w
option" is something that makes perfect sense to Unix users, who are used
to
command line options being introduced by a "-".

-- 
Rhodri James  *-*  Wildebeeste herder to the masses
If you don't know who I work for, you can't misattribute my words to them

 ... Lucy and Ethel?


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

Date: 19 Dec 1997 02:21:34 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: Newbie Pattern Matching question
Message-Id: <slrn69jm4o.d0p.gabor@vinyl.quickweb.com>

In comp.lang.perl.misc, Curt Cranfield (curt@vphos.net) on Thu, 18 Dec 1997 13:56:35 -0800 writes:
# Hi,
# 
# I am having trouble doing a certain pattern match.  What I am trying to
# do is figure out how I can do a pattern match on '(xac)'.  For example
# if the string was:
# 
# the dog (big) ran home

@brckts = /\(([^)]*)\)/g;
this will grab everything between brackets, not including the
brackets.

gabor.
--
    Randal said it would be tough to do in sed.  He didn't say he didn't
    understand sed.  Randal understands sed quite well.  Which is why he
    uses Perl.   :-)
        -- Larry Wall in <7874@jpl-devvax.JPL.NASA.GOV>


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

Date: Thu, 18 Dec 1997 17:50:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Andrew M. Langmead" <aml@world.std.com>
Subject: Re: No Flock! -- Now What?
Message-Id: <Pine.GSO.3.96.971218174947.23295L-100000@user2.teleport.com>

On Thu, 18 Dec 1997, Andrew M. Langmead wrote:

> The win32 programming API has some support for named semaphores,
> right? If that is the case, maybe perl could implement flock in terms
> of a named semaphore 

Patches welcome. :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 18 Dec 1997 19:21:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: pgp encrypion via perl script
Message-Id: <comdog-ya02408000R1812971921410001@news.panix.com>

In article <3499b474.0@union>, alano@ncd.com (Alan Olsen) wrote:


>Open3 tends to lock up on many (most) versions of PGP.  (At least all the ones 
>I have tried under BSD.)  Two way piping and some programs do not mix.  

not that i have a lot of experience with BSD, but perhaps the code doens't
handle some gotcha or something?  i am curious what you have tried since
i'd like to make anything i come up with as portable as possible. :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Thu, 18 Dec 1997 17:37:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: brian d foy <comdog@computerdog.com>
Subject: Re: Q: limiting the input array size
Message-Id: <Pine.GSO.3.96.971218172540.23295F-100000@user2.teleport.com>

On Thu, 18 Dec 1997, brian d foy wrote:

> In article <Pine.GSO.3.96.971218103913.18763I-100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> wrote:
> 
> >On Thu, 18 Dec 1997, brian d foy wrote:
> 
> >> however, i guess you could make the server wait by not sending as many
> >> bytes as you said you were going to, hence creating a denial of service
> >> style attack.  oy - i don't think CGI.pm could recover from such a
> >> thing, but i hestitate to test it. 
> >
> >That's really the server's problem, not CGI.pm's problem. Right?
> 
> redundacy is nice, but i don't seem anyway around it.  i was thinking
> that CGI.pm could give up after a set time and let the server
> release the connection. 

No, that won't work. On most servers, your script (including CGI.pm)
doesn't even start until the remote data have all arrived. And even if
that weren't the case, having the script quit wouldn't necessarily cause
the server to release the connection. Every way I look at it, it's the
server's worry. :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 19 Dec 1997 01:23:51 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Script calls embedded in web pages
Message-Id: <67cib7$hdk$5@comdyn.comdyn.com.au>

In article <349892E1.44E0@aol.com>,
	snailgem@aol.com writes:
> If your images are in cgi-bin or one of its subdirectories, move them
> somewhere else. I don't know why, but I could never get an image there
> to display correctly.

Maybe because the server assumes that it is a cgi app?

what does this have to do with perl?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: Thu, 18 Dec 1997 17:41:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Thane & Leslie Eisener <thaneles@removethis.cyberus.ca>
Subject: Re: Sending a signal to a process owned by someone else
Message-Id: <Pine.GSO.3.96.971218173947.23295I-100000@user2.teleport.com>

On 19 Dec 1997, Thane & Leslie Eisener wrote:

> I have a perl script which, in certain cases, needs to send a signal to
> a daemon process.  The daemon process is spawned by the inittab and
> therefore runs as root but the original script must run as someone other
> than root. 

So, did you have a problem? :-)

If your system prevents you sending signals to someone else's process (as
it should) that's not really a Perl problem - you'd have the same
difficulty if you were programming in C or any other language. But you can
write a program which is set-id in Perl, and that may allow you to do what
you want. Be sure to read the perlsec manpage. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Thu, 18 Dec 1997 18:11:09 -0600
From: geldridg@progsoc.uts.edu.au
Subject: Re: Teaching programing
Message-Id: <882489735.590086156@dejanews.com>

Randall wrote in response to Anthony David's message:

> I agree with most of adavid's comments...

I also agree .. my story:

My first language was Pascal in the early 80's. When I started work
as an Electrical Engineer I was forced onto Fortran. I've never really
gotten into C (and hence C++ and Java).  During 1992/93 I took an
Grad. Dip in Computing and was introduced to COBOL through Micheal
Jackson's ``Jackson Structured Technique'' (JST) and Bertrand Meyer's
Eiffel.  I have a strong belief in the Bertrand Meyer's Eiffel Method,
and the supporting Eiffel language.

I'm currently using Perl in an OO way thanks to Tom's very useful
perltoot:

   http://www.perl.com/perl/all_about/perltoot.html

and like Anthony I share his feelings about Perl:

   ``The beauty to me of Perl is that after struggling with a
     number of languages, I can have a true sense of  "I can get
     there from here". The language does not get in the way of
     what I want to do and how I want to express it.''

> And for OO, I'd recommend Smalltalk.  There are public implementations
> out there ("Squeak" even fits the Blue Book smalltalk very closely),

There are many OO languages. The ``OO Soapbox'' available from:

   http://www.elj.com/

details some of them - Simula, Eiffel, C++, Java, Perl, Python, Idol,
Blue and many more. The OO Soapbox also tries to collect various view
points regarding OO features such inheritance, genericity, garbage
collection. The `What's New' section provides a listing of recent
additions (i.e. the last 6 months).

Other OO teaching languages include Eiffel, or Blue which is:

   ``an OOP especially for teaching OO concepts to 1st year students''

developed at the Uni of Sydney. They have papers, and Linux and Win95
versions of the environment that supports Blue.

Java seems to be the number teaching language at present, but there
are many obstacles for using Java as a first language -- see the
``OO Soapbox'' for links, in particular Graham Perkins ``Comparative
Programming Languages'' at:

   http://www.mk.dmu.ac.uk/~gperkins/language/

I've even recently heard one German Uni. switching back to Eiffel
after a year of using Java.

> and it's really pure OO, unlike that C++ abomination or the Java
> half-breed.

To quantify what Randall is saying here, see Ian Joyner's ``C++??
Critique'' which provides:

   ``an analysis of some of the flaws of C++ .. The critique uses
     Java and Eiffel as comparisons to C++ to give a more concrete
     feel to the criticisms, viewing conceptual differences rather
     than syntactic ones as being more important.''

    [ NB: Available from http://www.elj.com/ - BTW: Ian is in the ]
    [     process completing the next edition of the Critique.    ]

A digression ..
---------------

Java has been good for OO - it has introduced many people to OO
for the first time. OO is now not the exclusive domain of gurus.
Also, there have been many ``syntactically and semantically battered''
(sorry that's probably a bit strong for some, but others can
relate I'm sure) C++ converts, some who even now think that
``garbage collection'' is OK.

I believe Java has also raised the interest in Eiffel - the traffic
on my sites has doubled in the last 2-3 months. I'm not sure why!
Maybe the Dvorak article in PC Magazine or the realistion from the
Java community that Java falls short of Eiffel in many respects
relating to OO features - see Bertrand's 2nd Historic mistake at:

   http://www.elj.com/elj/v1/n1/bm/mistake/

for ample evidence. My own opinion is that Java is here to stay
and that it will (by sheer demand from the Java development
communuity) progressively add MI, genericity and Design by
Contract. In the mean time Java has introduced many people to
OT for the first and I think a lot of them will not want to wait
around for Sun to move Java upto Eiffel's level.

> .. Sure, the real market never took off on Smalltalk, but
> once you get it down, learning how half-object solutions like Perl and
> Java works becomes much easier (and then you start wishing that
> everything was an object instead of just the higher life forms :-).

Nicely put - I feel the same. We are starting to see more and more
CPAN modules with OO interfaces, many of which I have used to help
me develop things I could only dream about 12 months ago, eg.:

  http://www.tg.nsw.gov.au/sem/realtime/ppsdic/

  [ Thanks Randall, Tom, Larry and the Perl Community. ]

My hope is that Perl can move up from a ``half-object solution..''
to a complete object solution with better support for:

 .. multiple inheritance.. see:                                     ]

     http://www.elj.com/elj/v1/n1/gew/

  for Eiffel's clean and elegant approach - repeated inheritance,
  feature renaming and adaption, and the integration with design
  by contract.

 .. design be contract..See a Java attempt at:

  . http://www.olsen.ch/export/User/kramer/icontract.ps.Z

A Perl Development Environment ..
---------------------------------

To go any further with OO Perl we need a development environemt
that has been designed to support OO. I believe the Eiffel vendors
have set the standard here:

 .. ISE Eiffel's ( http://www.eiffel.com ) EiffelBench:

    http://www.eiffel.com/products/bench.html

 .. Object Tool's Visual Eiffel. See: http://www.visual-eiffel.com/

  . The graphical browser
    http://www.object-tools.com/visual/manual/gbrowse.htm

  . OOCAPI : OOCAPI - the OO Compiler API
    http://www.object-tools.com/paper/oocapi.htm

They provide various short and flat forms of classes, simple navigation
of the OO structures via inheritance and client relationships, nice
visual representations (ie. ``bubbles and arrows''), queries on
feature and attribute availability ..

  [ NB: I've been using UltraEdit ( http://www.ultraedit.com/ )  ]
  [     which is a step up from Notepad - it has line numers :-) ]

The Perl community would be grateful for a similar tool. I'm trying
to convince the Eiffel developer community that with Eiffel
it is now possible to develop such an environment which would draw
a favourable response. Send me an email if you are interested
in such a environment (it will provide some evidence for potential
developes).

Thanks for your listening ..

Geoff

-- geldridg@progsoc.uts.edu.au
-- http:/www.elj.com/

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Thu, 18 Dec 1997 18:51:04 -0600
From: guardian@ok.azalea.net
Subject: What is wrong with this script?
Message-Id: <882492101.726859778@dejanews.com>

Can anyone tell what is wrong with this script?  I got it from
apacheweek... It gives me this error at runtime: Can't use an undefined
value as filehandle reference at ./htpasswd2dbm.pl line 23.

------------------------
#!/usr/bin/perl

# htpasswd2dbm.pl - convert htpasswd file to DBM format

# For details of how to use this program, see Apache Week issue 42
#     http://www.apacheweek.com/issues/96-11-22

while ($_ = $ARGV[0], /^-/) {
    shift;
    last if /^--$/;
    /^-htpasswd/ && ($htpasswd = shift, next);
    /^-group/ && ($group = shift, next);
}

if ($#ARGV != 0) {  print "Usage: $0 [-htpasswd passwdfile] [-group
groupname ] dbmfile\n";  exit(1); }

$dbmfile = $ARGV[0];

if ($htpasswd) {
    open($fh, $htpasswd) || die "Cannot open $htpasswd: $!\n";
} else {
    $fh = STDIN;
    $htpasswd = "-";
}

dbmopen(DBM, $dbmfile, 0644) || do {
    close(IN);
    die "Cannot dbmopen $dbmfile: $!\n"; };

while (<$fh>) {
    chop;
    ($user, $enc) = split(/:/);

    $value = $enc;
    $value .= ":$group" if ($group);

    $DBM{$user} = $value;

    print "user $user added to $dbmfile\n";
}
close($fh);
close(DBM);

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

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

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