[8987] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2605 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 15 01:07:31 1998

Date: Thu, 14 May 98 22:00:51 -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           Thu, 14 May 1998     Volume: 8 Number: 2605

Today's topics:
    Re: Can a FILEHANDLE be passed to flock() with an expre (Martien Verbruggen)
    Re: Can a FILEHANDLE be passed to flock() with an expre (Leonard Miller)
    Re: Can a FILEHANDLE be passed to flock() with an expre <tchrist@mox.perl.com>
    Re: Does Perl have a IDE?I don't like command line. (Mark Maurer)
    Re: Does Perl have a IDE?I don't like command line. <ljz@asfast.com>
    Re: Does Perl have a IDE?I don't like command line. <rra@stanford.edu>
    Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
    Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
    Re: Does Perl have a IDE?I don't like command line. (Tad McClellan)
    Re: Does Perl have a IDE?I don't like command line. (Tad McClellan)
    Re: Does Perl have a IDE?I don't like command line. (Tad McClellan)
    Re: Does Perl have a IDE?I don't like command line. <ljz@asfast.com>
        extracting utmp structure (Farid Hamjavar)
    Re: extracting utmp structure <mambuhl@tiac.net>
        help with search engine. (Robert A. Mosley)
    Re: perl text editor for windows95 <justin@nectar.com.au>
    Re: perl text editor for windows95 (Stuart McDow)
    Re: Removing ^M at the end of each line of a file. <tchrist@mox.perl.com>
    Re: Tearing my hair out over Regular Expressions - help <rbskipper@wimberley-tx.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 15 May 1998 03:36:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Can a FILEHANDLE be passed to flock() with an expression?
Message-Id: <6jgd7u$mf7$1@comdyn.comdyn.com.au>

In article <millers3-1405981904570001@d214.pm6.sonic.net>,
	millers3@sonic.net (Leonard Miller) writes:

> Can a FILEHANDLE be passed to a flock() functions with an expression like
> this?

Read a few things:

# perldoc perlfaq5
     How can I make a filehandle local to a subroutine?  How do I
     pass filehandles between subroutines?  How do I make an
     array of filehandles?

And Tom Christiansen's recent FMTEYEWTK article, which he posted
recently to comp.lang.perl.misc. Consult that group, or do a dejanews
search on:

~g comp.lang.perl.misc & ~s FMTEYEWTK

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: Thu, 14 May 1998 20:55:28 -0700
From: millers3@sonic.net (Leonard Miller)
Subject: Re: Can a FILEHANDLE be passed to flock() with an expression?
Message-Id: <millers3-1405982055290001@d164.pm12.sonic.net>

In article <6jg8f4$e3h$4@csnews.cs.colorado.edu>, tchrist@mox.perl.com
(Tom Christiansen) wrote:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     millers3@sonic.net (Leonard Miller) writes:
> :Can a FILEHANDLE be passed to a flock() functions with an expression
like this?
> 
> Did you try?
> 
> --tom

Yes, I did try and it seems to work.  Thanks for the push. Here is my test:

#!/usr/bin/perl

use Fcntl qw(:flock);
$file = "somefile";

open(FILE, "$file") || die "Can't open file";
$x = (lock(FILE));
print "$x\n\n";
unlock(FILE);
close(FILE);

sub lock {

    local ($fhandle) = @_;
    flock($fhandle,LOCK_EX);
}



$x returns 1, therefore true. But why is this passing as an expression not
mentioned in the flock() decription like it is with seek() and fileno()
and open()?

-Leonard


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

Date: 15 May 1998 03:55:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can a FILEHANDLE be passed to flock() with an expression?
Message-Id: <6jgebb$okj$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    millers3@sonic.net (Leonard Miller) writes:
:$x returns 1, therefore true. But why is this passing as an expression not
:mentioned in the flock() decription like it is with seek() and fileno()
:and open()?

Because anytime you use a FILEHANDLE, you may use an indirect
filehandle.  See my posting from a few days ago on these.

--tom
-- 
    char program[1];        /* Unwarranted chumminess with compiler. */
	    --Larry Wall in the Perl source code
    (quoting Henry Spencer (quoting Dennis Ritchie (quoting Brian Kerninghan)))


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

Date: 14 May 1998 23:18:45 -0400
From: mwmaurer@mtu.edu (Mark Maurer)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jgc6l$cbm$1@pace1.cts.mtu.edu>

fsg@ultranet.com wrote:
: mwmaurer@mtu.edu (Mark Maurer) writes:
: >fsg@gallo.ultranet.com wrote:
: 
: >Regular expressions are considered dumbing-down?  Hardly.
: 
: I don't know about you, but I would rather drown myself than try to do
: by hand the things the regular expression engine does.  I invite you
: to go read the code and determine for yourself whether it's making
: things ridiculously more easy for you or not.

And I didn't disagree with you.  I have looked at the regular expression code
in the perl source, and hell yeah, it makes things easy.  But I also said
that they also invite problems of their own.  Regular expressions themselves
can be complex as hell, and I've met enough people who don't use them because
they don't understand them.  THAT is why I say they are not dumbed down...

: >: If you're claiming that's because they're clinging to a frontier concept of
: >: programming and don't want to be namby pamby, I would have to disagree.
: >: I haven't met a programmer yet who doesn't use them whenever available.
: 
: >You have now... ;)
: 
: So you've never used CGI.pm, MakeMaker.pm, or IO.pm?  Or even socket.pl?
: Answer honestly.

Have I used them?  Yes.  Do I use them whenever possible?  Hell no...

: >IMO, wizards DO dumb-down programming.  To many people are just a couple of
: >mouse clicks away from creating something, and saying that they "programmed"
: >it, when in reality they couldn't create hello world in said language if
: >given a text editor and a compiler.
: 
: So?

You think that is a good thing?  To let people believe that they can program,
until a problem occurs, or they need to do something that the wizards can't
do?  What happens then?  

Dumbing down is NOT a good thing, and that is why I do not advocate wizards.
Eventually, it could get to the point where no one understands anything, but
when a problem occurs, they sit and stare dumbly at the screen.

: >  You and I and many others may know that
: >there is nothing magical about wizards, but there are too many people out
: >there that they are magical.  All IMO, of course...
: 
: I'm confused.  Is this about the fact that their opinion of themselves
: becomes too high?

No.  not in the least.

: Not only is there nothing magical about wizards, but there's nothing
: magical about being a programmer, either.  Even if they're misrepresenting
: themselves as programmers, surely there's no harm done to anyone else.

Really?  They pass themselves off as programmers, get a job, start doing some
big project, something breaks, and then what?  The employer is left dangling,
and that most certainly cause harm to the business.

Ach, but this is getting further away from what this discussion started out
as...
-- 
Mark Maurer  markm@dct.com                      mwmaurer@mtu.edu
Programmer,  Digital Magic Interactive          http://www.dminteractive.com
Senior,      Michigan Technological University  Houghton, MI
-- Views do not represent those of my employer or school


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

Date: 14 May 1998 23:34:00 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <ltbtt02onr.fsf@asfast.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, fsg@ultranet.com writes:
> :But unless you can explain how
> :win32 people asking questions in comp.lang.perl.misc will cause the downfall
> :of Perl, I'm afraid you're just being unpleasantly religious.  
> 
> It's trivial: They flood the group with useless questions that they are
> too lazy to lift a finger for themselves.  They don't look up the docs
> even though these are included on their very systems.  The problem is that
> these people do not come from a can-do, do-it-yourself, tinker-and-play,
> reseach-is-educational background.  They aren't used to online docs that
> they didn't have to pay the Great Taxman Who in Redmond Abideth for.
> They think that USENET somehow owes them something, that it's around to
> read them bedtime stories from the manpages.  They are used to asking a
> wizard (that's hacker wizards, not MSFMH-corrupted jargon) to do their
> reseach for them, and for free, no less.  
> 
> And the wizards are tired of it.  Damned tired.

Well, thank God that clp.moderated is coming soon, so that the tired
wizards can have a place to rest, recuperate, and enjoy themselves
among each other without being molested by the unwashed masses.  :)

Let's face it ... the days when computers were the domain of a select
few freaks, wizards, and hackers are over.  Kids who have been
routinely using computers since early grammar school are already in
college, or even older.  It won't be long before the home computer
will be considered to be as much of an appliance as the washing
mashine and as much of an everyday fixture as the TV set and the
telephone.  Like it or not, millions of regular folks who never heard
of Alan Turing or Donald Knuth or Kernighan and Ritchie are trying and
will continue to try their hands at programming.

Lots of people like to share their knowledge.  When one friend
discovers a great new recipe, he or she often likes to share it with
others.  When a person needs help with some car repairs, he or she
sometimes asks a friend for some pointers or a couple extra hands.  As
computers become as commonplace as kitchen utensils and automobiles,
more and more of us will approach them the way we approach the other
everyday gadgets and institutions in our lives, and we will happily
share our knowledge with each other.

Calling people who do this names, railing at them, or insulting them
will not work to keep them away.  A few will try to understand what
you're so upset about and in the process, perhaps learn a thing or
two.  However, most people will just ignore you or tell you to stick
it where the sun don't shine.  Some will even label you as crotchety
old-timers who are pining away for the "good old days" as the world
passes you by ... and in some cases, they will be right.

And these "everyday" people are bright and creative and self-motivated
in approximately the same percentage as we are.  They are just less
anti-social on the whole, and they might ask a few more questions of
each other and of us as they are learning.

Even if you disagree with my faith in humanity, you still have to
accept the fact that all sorts of "everyday folks" are going to be
coming into what used to be the rather isolated world that we have
inhabited for years ... and they're here to stay, so we might as well
learn to deal with them without having useless, silly, and ultimately
futile fits of apoplexy.

As for Perl ...

One thing that sets Perl apart from many other languages is that it's
so damned *useful*.  Once you get the hang of it, Perl allows you to
perform otherwise complicated procedures with a minimum of effort, and
with your attention focused on the tasks at hand and not on the
tedious details of low-level programming constructs.

Another thing that sets Perl apart from many other languages is that
for many people, it seems to be a bit tricky to get familiar with
 ... at least initially.

The combination of this usefulness and trickiness sets up the
situation we are now seeing: more and more people want to use the
language, but many of them are having a tough time catching on to its
conventions and idiosyncracies.  If you don't like so many people
trying to use the language, then do something to make it *less*
useful.  If you don't like so many people getting stuck and asking
FAQ's, then do something to help people get the hang of Perl more
easily.

Of course, you could also try the "railing and name-calling" approach,
but this is ultimately a losing battle.

Or you can just go hide in clp.moderated and avoid the problem
altogether.  But even if you do, I would be willing to bet that
*someone* is going to come up with some sort of Perl IDE ... and
probably sooner rather than later.  Better that this IDE be created by
someone who really *knows* and understands Perl.

I personally think that the world would be a better place if *more*
programmers were to learn how to use Perl.  Productivity would
increase, and a higher percentage of available creative energy could
be devoted to the important tasks of the world as opposed to the
low-level programming constructs I mentioned above.

The Perl community has done a wonderful job with CPAN, documentation,
and other tools to help those who want to learn the language.  I hope
that this trend continues, and that we don't blow it as the next wave
of programmers (less geeky, more "everyday folks") come of age.
Otherwise, we might live to see Perl consigned to the same dustbin of
programming history as languages like JOVIAL, SNOBOL, and APL.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: 14 May 1998 20:51:37 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <m3af8kqjhy.fsf@windlord.Stanford.EDU>

Mark Maurer <mwmaurer@mtu.edu> writes:
> fsg@ultranet.com wrote:
>> mwmaurer@mtu.edu (Mark Maurer) writes:

>>> IMO, wizards DO dumb-down programming.  To many people are just a
>>> couple of mouse clicks away from creating something, and saying that
>>> they "programmed" it, when in reality they couldn't create hello world
>>> in said language if given a text editor and a compiler.

>> So?

> You think that is a good thing?  To let people believe that they can
> program, until a problem occurs, or they need to do something that the
> wizards can't do?  What happens then?

> Dumbing down is NOT a good thing, and that is why I do not advocate
> wizards.  Eventually, it could get to the point where no one understands
> anything, but when a problem occurs, they sit and stare dumbly at the
> screen.

Again, I think a lot of this argument is over definitions, and that the
definitions being used are highly unclear.

To me, a "wizard" is a programming tool that generates some sort of basic
code template for you which you're then supposed to fill in to make your
application.  The only thing like that in the Perl world that I've seen is
h2xs.

Modules are libraries.  That's a completely different thing than a wizard.
You aren't using a wizard when you link with libc.

MakeMaker is an odd case.  MakeMaker generates a Makefile for you, but I
know of very, very few people who then try to edit that Makefile.  At the
most, they'll tell MakeMaker to add some specific sections.  As such, I
consider MakeMaker to be a *tool*, not a library or a wizard; it doesn't
generate code templates, it generates an entire Makefile as an end product
from a specification.  Sort of like how the TeX system can generate a
PostScript document from a TeX source file.

Wizards can be useful.  I use the following metric for whether or not a
wizard is a good idea:  If I not only could have written *every bit of
code* that the wizard wrote for me but could have written it half-asleep,
then the wizard is saving me a lot of time and it's a good idea.
Otherwise, I think it's a very risky thing to base an application on,
because if you can't understand the generated code right away, you're
doomed when it comes to debugging.

Now if you're never going to actually touch code at all, but are just
going to drag boxes around on the screen, that's again something else.  So
is dragging boxes around and attaching code fragments to them.  People
really should recognize that programming paradigm; MUSHes and MUDs have
been using it for years.  Programming in Microsoft Access is pretty much
identical to programming inside a MUSH, except that the syntax and
interface are a little nicer.

If you're *only* dragging boxes around and are *never* writing any code,
you're not programming at all.  You're doing useful work, certainly, but
it's not programming.  Interface design?  Application layout?

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 15 May 1998 03:48:33 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jgduh$okj$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Lloyd Zusman <ljz@asfast.com> writes:
:If you don't like so many people getting stuck and asking
:FAQ's, then do something to help people get the hang of Perl more
:easily.

It is ultimately depressing to receive daily reminders of how useless
and ignored my work and that of others at documenting Perl, in manpages,
FAQS, webpages, and even books.  It is a rude slap in our faces, and
I don't understand why we're supposed to make kissy face when it
happens again and again on the very same day.  I don't know how
any man can.  You don't see Larry here.  You don't see Dennis in the
C groups.  And you don't wonder why, now do you?

:Or you can just go hide in clp.moderated and avoid the problem
:altogether.  

I certainly shall.  

--tom 
-- 
 The use of COBOL criples the mind; its teaching should, therefore, be
 regarded as a criminal offense.         -- E. W. Dijkstra


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

Date: 15 May 1998 03:51:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jge3c$okj$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Lloyd Zusman <ljz@asfast.com> writes:
:Like it or not, millions of regular folks who never heard
:of Alan Turing or Donald Knuth or Kernighan and Ritchie are trying and
:will continue to try their hands at programming.

Those who ignore history are doomed to repeat it.  Badly.

:of programmers (less geeky, more "everyday folks") come of age.

Sounds like you mean people who don't enjoy puzzle solving
and tinkering.  You really think they will be programming
computers?  I don't.  They won't have the gift.  They'll
just be posers.

--tom
-- 
    if (instr(buf,sys_errlist[errno]))  /* you don't see this */
        --Larry Wall in eval.c from the 4.0 perl source code


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

Date: Thu, 14 May 1998 22:54:24 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <g9egj6.fkf.ln@localhost>

Michael J Gebis (gebis@albrecht.ecn.purdue.edu) wrote:
: gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
: [A bunch of stuff that was much more hostile that I ever intended.]

: Last night, I decided, "Okay, I'm a proactive type of guy.  Let me
: listen to the other side."

: The problem we are having is that many Win users are asking dumb
: questions (which directly impacts me by clogging the newsgroup) and
: are writing a lot of ugly, uninformed code (which is bad for the
: universe in general.)


: Okay, sure, I can accept that for now.  So what is the right course of
: action?  What's a proactive type of guy like myself supposed to do?  I
: suppose that the moderated newsgroup will reduce my immediate problem
: (a noisy newsgroup) but won't address the karmic damage being done by
: the ugly, uninformed code being written.  That isn't good for anybody.


Surely you meant it isn't good for _everybody_?

If so, then I agree completely.

(but "anybody" would include me, and it would be better for me at least.
 I wouldn't see many FAQs anymore.  Hmmm... After a while, would I have to
 start calling them just AQs or something?  ;-)
)

Would be sad to have a bunch of poor code around though...


: I sincerely hope the answer isn't "randomly snipe the clueless to
: discourage them," 


That can't be the answer. 

I've not seen that happen much.

Seen (and contributed to) a *whole bunch* of 

   "randomly snipe the clueless to shame them into behaving 
    as expected by this society".

;-)

-----

The root cause (IMO, of course) of 90% of the topics discussed 
in these recent "meta threads" is old fashioned lack of manners.

The tenets of 'netiquette sort of "evolved". The fittest survived.
That is, there are good reasons for them. Things work better if
they are followed.

One of the primary 'netiquette rules is to check the FAQ for a
newsgroup before posting to that newsgroup.

This is pretty universal and is nothing specific to c.l.p.*

However, your chances of actually finding the answer to your question
are much greater here than in most groups.

'cause there is so much documentation.

Our curse and our blessing...



: because I've tried that, 

Me too.


: and it doesn't feel right
: (or seem to be working.)  

That was my conclusion as well. 

So now I spend half an hour a week in clpm instead of the order of
magnitude greater time that was my custom for a few years.

I feel much better now though    ;-)


: I also hope the answer isn't, "let ignorance
: fester," because that doesn't feel right either, and it's not very
: proactive.  


For me, at least, what matters is that the ignorant _wants_ a clue.

This is what every teacher (or just plain "helpful person") dreams
of. A sponge to pour it into.


There are so many gimme, gimme, gimme, posts that honest plain
questions get painted with the same brush.

Sad, but true.


I revel in letting the Gimmes fester however...


: and I'd like to apologize to the newsgroup in general for
: that.  I'm genuinely interested in a response to my question:  What
: can I do to help?


I've often thought of a Perl answer 'bot. One of those GUI pointy
clicky things where you type in your question and some AI/agrep/magic
happens and presents you with some pointers into the docs.

I've even saved off several mentions of similar things in previous
posts.


Just never got a round tuit  ( and learning enough AI for it to work
well would be, well, an "opportunity for growth" for me...)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 14 May 1998 23:10:23 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <f7fgj6.7lf.ln@localhost>

Greg Bacon (gbacon@cs.uah.edu) wrote:


: Not everyone is meant to be a programmer, but there's nothing wrong with
: not being one.  Being a programmer requires gifts that not everyone
: possesses.  I don't know of many specialties that just your average
: person can claim.  Not being a trained physician, I suspect physicians
: everywhere would be outraged if I attempted to practice their craft
: untrained.  Why does everyone think programming is a special case among
: professions?


Because, after all, programming is easy.

he, he...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 14 May 1998 23:04:27 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <bsegj6.7lf.ln@localhost>

Art Cohen (upsetter@shore.net) wrote:
: Greg Bacon <gbacon@cs.uah.edu> wrote:

: : The concept of an IDE is nice if you're into buttons and mouse pointing
: : and lots of windows.  Two xterms are nice if you're not.  I never said
: : that each and every user of a non-Unix platform sucks either.  '


: Just the vast majority? 

You seem to have a pretty harsh view towards POBs yourself. See below.


: Or was "the unappreciative, unthinking, and,
: hence, unworthy clueless droves of lose32 users" intended as a compliment?


See?

You seem to agree that the "vast majority" of them are either
unappreciative or unthinking or both...


Surely some significant portion of them can think, eh?


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 15 May 1998 00:29:35 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <lt4sys2m34.fsf@asfast.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     Lloyd Zusman <ljz@asfast.com> writes:
> :Like it or not, millions of regular folks who never heard
> :of Alan Turing or Donald Knuth or Kernighan and Ritchie are trying and
> :will continue to try their hands at programming.
> 
> Those who ignore history are doomed to repeat it.  Badly.

Agreed.  And those who truly want to learn how to program will find
out about Turing, Knuth, Kernighan, and Ritchie soon enough.  But
before they do, many of them may ask a few innocent questions here on
the net.  In most cases, this doesn't mean that they're lazy
freeloaders or ungrateful whiners ... only that they're naive and that
they're eagerly and hopefully looking for answers to their admittedly
beginners' questions.  Is that such a crime?

> :of programmers (less geeky, more "everyday folks") come of age.
> 
> Sounds like you mean people who don't enjoy puzzle solving
> and tinkering.  You really think they will be programming
> computers?  I don't.  They won't have the gift.  They'll
> just be posers.

No.  I'm not talking about people who don't enjoy puzzle solving.  I'm
talking about people who love learning, puzzles, and other challenges,
but who just go about it in a slightly more social fashion than some
of us old-fashioned, solitary geeks :) ... and I definitely include
myself in the latter group.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: 14 May 1998 21:31:31 -0600
From: hamjavar@unm.edu (Farid Hamjavar)
Subject: extracting utmp structure
Message-Id: <6jgcuj$31ki@mirac.unm.edu>



Greetings,

I plan to write a utility to spit out
all parts of the utmp structure (defined 
in utmp.h).  If you know of a working code,
please let me know for

Thanks,
Farid Hamjavar


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

Date: Fri, 15 May 1998 00:31:36 -0400
From: "Martin Ambuhl" <mambuhl@tiac.net>
Subject: Re: extracting utmp structure
Message-Id: <6jgg6n$q53@news-central.tiac.net>


Farid Hamjavar wrote in message <6jgcuj$31ki@mirac.unm.edu>...
:
:
:Greetings,
:
:I plan to write a utility to spit out
:all parts of the utmp structure (defined
:in utmp.h).  If you know of a working code,
:please let me know for
:
============
Since utmp is not part of standard C, it is impossible for
anyone in comp.lang.c to be sure that his version and yours are the
same.  This is one of the reasons that implementation-specific
questions are treated harshly in comp.lang.c.  As a general
rule, when your crossposting includes comp.lang.c and
any of the others here, comp.lang.c does not belong in the
list.

If your utmp looks like mine:
struct utmp
{
 short ut_type;
 pid_t ut_pid;
 char ut_line[UT_LINESIZE];
 char ut_id[2];
 time_t ut_time;
 char ut_user[UT_NAMESIZE];
 char ut_host[UT_HOSTSIZE];
 long ut_addr;
};
then it  only the most klewless would not know how
to display the contents of this strucure.  There is nothing
tricky except for the non-standard pid_t type
(it is often an int).
========

:Thanks,
:Farid Hamjavar




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

Date: Fri, 15 May 1998 03:30:01 GMT
From: ramosley@ramosley.com (Robert A. Mosley)
Subject: help with search engine.
Message-Id: <355bb69c.20213063@news.nacs.net>

I am developing an algorithm for a search engine for a simple site.
The pages will be located in a small directory structrue like below

root/
root/store1
root/store2
root/store3

In each directory will be the html files ... i have developed the
following steps to try to make a search engine ... i would appreciate
all the input people can provide me.

1.	Get a list of all of the html files from all of the sub
	directories.
2.	Place the list of files into an array.
3.	Take the first file from the array and apply the filehandle.
4.	Open the file with no locks ... none needed since they are
	static files.
5.	Search the file for the search string using a basic regex, and
	if found return the position of the instance.
6.	Search for the previos instance of a period, and then hop
	forward to the next charachter.
7.	Place the next 50 charachters and/or spaces into the return
	array.
8.	Continue searching for the next instance of the search string
	in the same file.
9.	Repeat steps 5 to 8 until the file is completed.
10.	Assign the file handle to the next file and continue until
	done. (Obviously close the prior file handle after the file is
	read in)
11.	Print out the file header.
12.	Print out the results with links to the files.
13.	Print out the file footer.

Thanks ahead of time for the input.

Mike Dori


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

Date: Fri, 15 May 1998 12:51:51 +1000
From: Justin Wills <justin@nectar.com.au>
Subject: Re: perl text editor for windows95
Message-Id: <355BADC6.848B7EBE@nectar.com.au>

Diane Strahl wrote:

> Can someone recommend a good, easy-to-use text editor to use for writing
> perl programs on windows95? I used bbedit on a friend's mac, which is
> the sort of thing I'm looking for. I've looked at vim and emacs, but
> they seem more complicated than what I want. Are they worth spending the
> time to learn? What are the advantages of these? Anything out there with
> pull-down menus rather than having to memorize all the commands which
> need to be typed in? Right now I'm using the basic windows95 text
> editors - notepad and wordpad. It'd be nice to use something that at
> least had syntax coloring.
>
> Thanks!
>
> Diane


http://www.solutionsoft.com/perl.htm

can't say I've used this (I try never to run windoze), but I kept the URL
anyway,.



--

Regards,

Justin Wills
justin@nectar.com.au

Just don't create a file called -rf.  :-) --Larry Wall





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

Date: 15 May 1998 03:57:35 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: perl text editor for windows95
Message-Id: <6jgeff$kv1$1@ns1.arlut.utexas.edu>

Diane Strahl <jimndi@sgi.net> writes:
>
> I've looked at vim and emacs, but they seem more complicated than
> what I want. Are they worth spending the time to learn? What are the
> advantages of these? Anything out there with pull-down menus rather
> than having to memorize all the commands which need to be typed in?

Can't say much about vim, but I hear it's pretty good.

IMO, you can't go wrong with emacs. The learning curve is steep, but
it's extremely powerful. And it does have pulldown menus. As far as
memorizing commands - like learning to use any other tool, just use it
enough and you'll memorize the commands without realizing that you
did.

 ...and I've yet to beat emacs at gomoku. How well does your editor
play?

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
            "Look for beauty in roughness, unpolishedness"


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

Date: 15 May 1998 03:13:19 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Removing ^M at the end of each line of a file.
Message-Id: <6jgbsf$md4$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    "N6006024" <pernande@dev.amadeus.net> writes:
:After having saved a perl script with Homesite 3.0, when I open the script
:using vi I can see that each line is ended by a  ^M. 

How can this be?  Are you running some CP/M file under a normal
system or what?  You should not see \cM's in your file ever.

And you are deeply confused about reading and writing the same
filter.  You'd need a -i filter instead.

--tom
-- 
Fungus doesn't take a vacation.  --Rob Pike


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

Date: Thu, 14 May 1998 22:25:36 -0500
From: Robert Boyd Skipper <rbskipper@wimberley-tx.com>
To: Luke Steele <ljs@cableinet.co.uk>
Subject: Re: Tearing my hair out over Regular Expressions - help!
Message-Id: <355BB5B0.5A33A255@wimberley-tx.com>

You're catching too much white space because your capturing match is
greedy.  You're running over into the next field name because \s matches
newlines.  Since the only white space you need to worry about is a simple
space, this regex will work:

/^contact: *(.*?) *$/im;

(N.B. There are spaces before the first and third *)

The best book on the subject is Mastering Regular Expressions, by Jeffrey
E.F. Friedl, published by O'Reilly & Associates, but there's also some
great info at CPAN at

http://www.cpan.org/doc/FMTEYEWTK/regexps.html

I hope this helps in time.

Skipper


Luke Steele wrote:

> "CONTACT:  Luke Steele  \nADDRESS: asdf  \n" =~
> /^CONTACT:\s*(.*)\s*\n/gmi;
> $&==CONTACT:_______Luke Steele___
> $1==Luke Steele___
>
> (The idea is $1 should contain Luke Steele with no spaces afterward.)
>
> "CONTACT:\nADDRESS:   asdf   \n" =~ /^CONTACT:\s*(.*)\s*\n/gmi;
> $&==&:CONTACT:
> ADDRESS:___asdf___
> $1==ADDRESS:___asdf___
>
> ($1 Should be empty.)
>
> If anyone could help me with this problem I'd be extremely grateful -
> it's been holding me up for a couple of days now!  Also if anyone
> could recommend any books that could help me that would be useful too
> (I already have Learning Perl & Programming Perl - I've read the first
> and I'm working on the second.
>
> Thanks again for any help!
>
> --
> Luke Steele
> ljs@cableinet.co.uk





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

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

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