[13013] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 423 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 8 20:06:41 1999

Date: Sun, 8 Aug 1999 17:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 8 Aug 1999     Volume: 9 Number: 423

Today's topics:
    Re: I guess this is a Misc question: Cgi-bin <newsgroup@bigwig.net>
    Re: I guess this is a Misc question: Cgi-bin <mike@crusaders.no>
        kill pid scripts <dutch@mindspring.com>
    Re: matching ONLY first match in dada stream... (Abigail)
        matching ("Bill Jones")
    Re: Nastiness contrary to the spirit of perl? (Sam Holden)
    Re: Net::Whois works under Win32? (elephant)
    Re: OffTopic Was(Re: Where to find help other than perl (Graham Ashton)
        Perl 4/BSD Question:  Small Files not being created, no <bNoOuSrPdAaMa@earthlink.net>
    Re: System call in Win NT, AS Build 518 <flavell@mail.cern.ch>
    Re: Urgent - Using flock() (Graham Ashton)
    Re: using __PACKAGE__ (Mark-Jason Dominus)
        Web Perl <janshadebeach@email.msn.com>
    Re: Web Perl (Graham Ashton)
    Re: Where to find help other than perldoc and books. (Abigail)
    Re: Where to find help other than perldoc and books. <uri@sysarch.com>
    Re: Where to find help other than perldoc and books. (Abigail)
        Win32: Window title from process id? txh666@my-deja.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sun, 8 Aug 1999 23:58:33 +0100
From: "Ben Quick" <newsgroup@bigwig.net>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37ae2437.0@news2.cluster1.telinco.net>

David H. Adler wrote in message ...
>In article <37ab6d5f.0@news2.cluster1.telinco.net>, Ben Quick wrote:
>>
>>On the whole most of the posters in this group come across as regarding
>>themselves as better than everybody else and therefore above everybody
>
>Actually, although this charge is often leveled at this group, for
>the most part this is not true.  What *is* true is that they are quite
>tired of people not following traditional usenet etiquette when
>posting here.  Usenet etiquette seems to be a dying art
>unfortunately.  Looking to other resources and hanging out on the
>group to get a feel for it before posting are hallmarks of said
>etiquette.  Everyone used to follow those rules, but unfortunately,
>with everybody and their dog getting on usenet, these behavioral
>concepts that help usenet run smoothly get plowed under.  (I think the
>dogs are doing the better job... :-)
>
>In particular, the FAQ posted towards the top of this group should
>have indicated that your question was not appropriate here, and *why*
>such impropriety is a bad idea.  My guess here is that you didn't read
>it.  Reading the group's FAQ also used to be standard practice.
>
>Although I don't pretend to speak for everyone, I believe that these
>are the main reasons that some people get flamed when asking
>inappropriate questions here.
>
>Quite frankly, the attitude that many newer posters present -
>i. e. that they shouldn't have to worry about being in an
>inappropriate forum - is one that find disturbing simply because it
>indicates a lack of regard for a system that is the way it is to make
>things more useful for everyone.  *shrug*
>
>What is ironic is that, at the end of one of your responses to someone
>in this thread, you quoted his signature, which directed you to the
>location of information on being new to usenet, which would have told
>you all I've said and more. :-/
>
>>else. Well I'm sure I'm sorry for just starting out in perl and asking a
>>question
>
>And, had you actually asked a question that was appropriate for this
>forum (and indicated that you had tried to find the answer yourself),
>you probably would have gotten an answer easily.
>
>If you wind up going to one of the cgi groups with this question, I
>suggest you read their faqs first...

Fair points, but wouldn't it have been easier if I was given polite
responses like
"I'm sorry, I don't know the answer. But ou're in the wrong group really,
try asking in...."
or
"The answer is.... but really this is the wrong group. In future for this
type of question try asking in...."

>--
>David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
>"I didn't say I'd never slay another vampire.  It's not like I have
>fluffy bunny feelings about them.  I'm just not going to get too
>extra-curricular about it."
> - Buffy




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

Date: Mon, 9 Aug 1999 02:05:09 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <jWor3.634$Xp2.5452@news1.online.no>


Ben Quick <newsgroup@bigwig.net> wrote in message
news:37ae0697.0@news2.cluster1.telinco.net...
> >>>> Well I'm sorry for being off topic. But to be fair, everyone (if not
> >>>> most) here should know what the answer to my question is.

But that's not the point is it?

You had a problem with finding the right permissions on a certain catalogue
on your web-server for running cgi-scripts.

So - you needed to find out if this had anything to do with your OS, your
webserver or CGI in general. There are a lot of newsgroups that contain the
words os, webserver and cgi. You chose to ask your question in
comp.lang.perl.misc which contain none of these.

So, even though many of the people here know a lot about OSes, webservers
and CGI-scripts, you can't expect them to answer these off-topic questions
here. In fact, the only way to ensure that questions that doesn't belong in
this group are still considered off-topic is to keep denying to answer them.

> In here, I didn't realise I was off-topic

If you had read a FAQ you would have realized it
If you had skimmed through a couple of days worth of old messages you would
have realized it.
If you had lurked for a while you would have realized it.

And of course. If you had known (or cared about) netiquette, you would have
known to search for the FAQ, look through old messages and lurk.

--
Trond Michelsen





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

Date: Sun, 08 Aug 1999 18:59:18 -0400
From: "Dutch McElvy" <dutch@mindspring.com>
Subject: kill pid scripts
Message-Id: <7ol1k0$is0$1@nntp6.atl.mindspring.net>

Anyone else know of a script to kill specific hung processes?

The script below will not work either through command line or in a perl
script. Anyone know why?

kill -9 `ps -ef | grep foo | awk -e '{print $2}'`

I am trying to extract process ids generated by the command:
ps -ef |grep foo
and kill them

There are always multiple lines of processes. I figure that should be a way
to do this with regular expressions.

Thanks for any advice,

Dutch


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

Date: 8 Aug 1999 17:28:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: matching ONLY first match in dada stream...
Message-Id: <slrn7qs14r.8pr.abigail@alexandra.delanet.com>

Bill Jones (bill@fccj.org) wrote on MMCLXVIII September MCMXCIII in
<URL:news:199908082109.RAA03499@astro.fccj.cc.fl.us>:
|| On Date: 8 Aug 1999 13:19:49 -0500 abigail@delanet.com (Abigail), wrote:

You don't have a References: lines.

Please fix your newsreader.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 08 Aug 1999 18:22:28 -0400
From: bill@fccj.org ("Bill Jones")
Subject: matching
Message-Id: <199908082218.SAA03659@astro.fccj.cc.fl.us>


I see my error.  I am using

$/ = '';

to get the entire document up and then using

s{(technology\b)} {<A HREF="/cgi/http_webster?isindex=$1">$1</A>}im;

To match once per document, not line.

But I either get everything, as if I was using '/g', or
nothing - because of:

    print ORECORD and next if (/DTD/); # Skip non-matches...

type lines.  But it's all fixed now; sorry for the disturbance.

-Sneex-



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

Date: 8 Aug 1999 23:27:32 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <slrn7qs4js.pqi.sholden@pgrad.cs.usyd.edu.au>

On Sun, 08 Aug 1999 18:09:21 GMT, Matt <mck@iag.net> wrote:
>On 8 Aug 1999 17:17:10 GMT, fl_aggie@thepentagon.com (I R A Darth
>Aggie) wrote:
>
>>Oh, yes, I do. You were morphing your From: line, and the only reliable
>>fingerprint for your posts was your ISP. In my experience, the only people
>>who morph around like that are those attempting to evade killfiles. Such
>>behaviour is considered rude. You don't want to post with a deliverable
>>address? fine, but use only *one*.
>
>Very well. I have been reprimanded, my knuckles are stinging, and I
>have amended my foul ways.
>
>>Because that was the only reliable way of nuking *your* posts. This is
>>something that *you* thru *your* actions have directly caused.
>
>I just do not understand the nuke happiness around here. During an
>evaluation phase, where I was comparing Perl and Tcl for a project, I
>monitored both groups. John O. started a thread in comp.lang.tcl
>called "Why do you hate Perl?"
>(http://x28.deja.com/[ST_rn=ps]/getdoc.xp?AN=450022348) For someone
>who obviously had a personal interest in seeing the Tcl language
>succed, such a subject seemed rather inappropriate. Even some of his
>supporters suggested that he phrase the question differently. 
>
>My point here is that I chose to ignore the "misstep of politeness",
>and I read the thread for it's technical value. In the end, a pro-Perl
>post or two had the best value to me, as they were written in a
>matter-of-fact, polite manner. These replies did not include any
>killfile threats, they simply stated the useful facts. In the end, I
>chose Perl for the project.

But did the posters continue to munge their From: lines? Did they continue
to disregard conventions, or was it just another interesting and sometimes
humourous thread? I suspect the later.

I also suspect that comp.lang.tcl doesn't have the volume of clpm. Seeing
I don't read it and there are only 4500 posts listed I am now sure that
it doesn't.

When the volume gets high people killfile. The normal attitude is that it is 
better to miss a few good threads then it is to be bombardard by those who
refuse to do the right thing. 

You might send some useful posts in the future, lots of people won't see
them, but that's a small price to pay.

>But if you indicate that all of my posts should be squelched because I
>merely made an error in usenet etiquitte, I have equal difficulty in
>believing that those with your attitude are more interested in a
>cleaner c.l.p.m.

Making an error is one thing. Continually refusing to acknowledge that you
have, and repeating the behaviour time and time again is a completely
different story. That's the behaviour killfiles are for, if someone keeps
sending Make Money Fast posts then killfile them, if someone keeps
sending non-conformant posts then killfile them, if someone keeps asking
FAQs then killfile them, if someone refuses to follow etiqutte then killfile
them.

Occasional mistakes are one thing. Intentional repeatition is another thing
entirely. 

-- 
Sam

Computers in the future may weigh no more than 1.5 tons.
	--Popular Mechanics, 1949


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

Date: Mon, 9 Aug 1999 09:47:16 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Net::Whois works under Win32?
Message-Id: <MPG.1218c2136d69364c989c03@news-server>

Horace Ho writes ..
>Does anyone have the Net::Whois module working
>under Win32 ActivePerl Build 518?
>
>The following code:
>
>use Net::Whois;
>
>$domain_name = "news.com";
>$domain_obj = Net::Whois::Domain->new($domain_name) or warn "nothing
>about $domain_name: $!\n";
>
>always return:
>
>nothing about news.com: Bad file descriptor

I get the same thing on WinNT under AS build 508 after installing 
Net::Whois using ppm

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 8 Aug 1999 22:21:50 GMT
From: billynospam@mirror.bt.co.uk (Graham Ashton)
Subject: Re: OffTopic Was(Re: Where to find help other than perldoc and books.)
Message-Id: <slrn7qs0nu.k6f.billynospam@wing.mirror.bt.co.uk>

In article <7okif5$k2s$1@ffx2nh3.news.uu.net>, James A Culp III wrote:
>
>No luck for me with trn I wish I could find it I'm more comfortable in
>a telnet session to my server.  (i.e. text only)

you could try slrn instead then. or you could spend 30 seconds at
http://www.google.com/, and come up with this;

http://www.cis.ohio-state.edu/hypertext/faq/usenet/usenet/
  software/trn-faq/part1/faq-doc-4.html
 
  (URL wrapped to keep my newsreader happy)

as for advice on how to program, your questions looked to be general
programming questions, as much as Perl questions. perhaps a book on
general programming would be a good idea.

I bought "The Practice of Programming" by kernigan and pike. it's got
quite a heavy C bias, but has some very good advice in it. otherwise,
you'll probably have more joy here if you post specific questions and
examples, as and when you encounter them.

I've picked up countless little nuggets from just trawling through other
people's posts. I tend to read articles by specific people too if I spot
them (mentioning no names), as you can be reasonably sure that they'll
contain something worth reading. You just need to learn who's posting
stuff that you find useful.

-- 
Graham

P.S. <billynospam@mirror.bt.co.uk> is a fully working address...


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

Date: Sun, 08 Aug 1999 16:06:05 -0700
From: Mike Bourdaa <bNoOuSrPdAaMa@earthlink.net>
Subject: Perl 4/BSD Question:  Small Files not being created, no error messages  either..
Message-Id: <37AE0D5D.FABDDE6B@earthlink.net>

Good day, Gurus.  I apologize in advance if this question has been
hacked to death.. I couldn't find the FAQ, or a very similar thread.  

This, in a nutshell, is my situation.  Disgusted by the various freebie
message board programs available, I set off to write my own
approximately two years ago for a group I am a part of.  

When I did so, I came from a heavy C background, so this may be part of
my problem (Bad, C, bad!)  Unfortunately, the ISP that we use does not
have Perl 5 installed, so I'm stuck using 4, and the program has been
devised using 4.. which has meant a lot of headaches with security
issues in the beginning.

Basically, however, there are several conditions under which a small
file will be created, which are (hopefully) unique such that no race
condition occurs.  Three of these are:

1)  A user changes their own preferences (email, password, last login
time), in which case their private config file is rewritten
2)  A user reads the new notes, which causes a temporary 'state' file to
be created, which lists all the messages to be read.
3)  A user posts a new message, or a reply to an existing message, in
which case of course a new file is created to hold the message.

Recently (over the last two weeks), errors have occurred with all three
functions.

The user file is created thusly:  The variables as read are in memory,
and output to a colon-delimited file fairly simply:  In pseudocode -

$the_data = join(":", @user_info);
open (FILE, ">filename") || &Fail(error message);
  print FILE $the_data . "\n"; 
close (FILE);

In theory, this should never fail.  Theory of course isn't reality. 
Recently, three separate instances have occurred where a BLANK file was
created rather than the data that should have been there.  The &Fail
function is not being called.

Likewise, the same type of code is used to post a message.. and several
new messages have also been seen which were completely blank (something
a user can't do on their own - at minimum, the person and date should
have been in the file.)

The biggest problem however has been people reading notes.  The code for
this is a bit different, since I need to 'pop' the top line off for the
message.

The 'state' files used look something like this

Topic/1/0
OtherTopic/2/5
OtherTopic/2/6
--END OF MESSAGES

What the program is supposed to do is take the first line out of the
file, load the corresponding message, and output the state file back to
where it was (without the top line)  [unless the top line was the --END
message, in which case it doesn't touch the message and just informs the
user that they're at the end]

The way it does this could definitely be improved.  In pseudocode:

copy state_file temporary_state_file
open(STATE, "temporary_state_file")
open(STATE2, ">state_file")
$top_line = <STATE>
while (<STATE>) {
    print STATE2 $_;
}
chop $top_line; 
return $top_line;

Again, I'm ending up losing all the data in the state file (and since
this occurs every time a message is read, this is the one that happens
most often.)

The only connection I could see was that perhaps the disk or inodes were
all used up, so I checked that.. it looks ok so far, but to be safe, I
am now logging that data when the errors actually occur (they seem to
occur only at specific times of day, in clusters.)  

My question to the group is this:  1)  Is there a better way of doing
the STATE files, given the limitation of Perl 4?   and 2)  Is there
anything else that could be causing open()ing an output file NOT to
trigger failure, and yet not actually put any data in that file, other
than a full disk/inode scenario?

The current df -ik output is:
Filesystem   1K-blocks     Used    Avail Capacity iused   ifree  %iused
Mounted on
/dev/wd2s1e    3656654  3290030    74092    98%  251273  639605    28%  
/u2

I thank you for your time reading this message, and for any assistance
you can lend me on this troubling issue.

-Mike Bourdaa



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

Date: Mon, 9 Aug 1999 00:01:13 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: System call in Win NT, AS Build 518
Message-Id: <Pine.HPP.3.95a.990809000042.511C-100000@hpplus03.cern.ch>

On Sun, 8 Aug 1999, Thomas Schmickl wrote:

[snip]

> > -- Great quotes in history >>> Socrates: "I drank what?"
> 
> I had the same problem. 

Really?




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

Date: 8 Aug 1999 22:13:37 GMT
From: billynospam@mirror.bt.co.uk (Graham Ashton)
Subject: Re: Urgent - Using flock()
Message-Id: <slrn7qs08i.k6f.billynospam@wing.mirror.bt.co.uk>

In article <7okth6$7s1$1@nnrp1.deja.com>, nochax@my-deja.com wrote:

>I need to lock a file but I don't know how.
>I'm using this:
>
>open (FILE, ">$filepath");

you should test the success of all your system calls. i.e.

open(FILE, ">$filepath") || die "can't open $filepath: $!\n";

>flock (FILE, 2);

rather than using "2", it's better to use the constants from the Fcntl
module (it's more portable, apparently). so you could start your script
off with (the Fcntl bit is off the top of my head, but I'm reasonably
confident it's right);

  #!/usr/bin/perl -w

  use Fcntl qw(:flock);   # :flock exports the bits you want
                          # read "perldoc Fcntl" for more

  #open goes here
  flock(FILE, LOCK_EX) || die "can't lock $filepath: $!\n";

$! is the last error returned by the OS, so it should give you a
reasonable clue as to why it didn't work.

one last thing; don't bother to unlock the file yourself, as close()
does this for you, and if you do it yourself you create a race
condition.

-- 
Graham

P.S. <billynospam@mirror.bt.co.uk> is a fully working address...


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

Date: Sun, 08 Aug 1999 22:30:21 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: using __PACKAGE__
Message-Id: <7ol0cs$kcv$1@monet.op.net>

In article <7o6s19$ft1$1@nnrp1.deja.com>,  <jschueler@tqis.com> wrote:
>Can't use string ("foobar::hello") as a SCALAR ref while "strict refs"
>in use at
> /tmp/hi line 9.
>
>
>Am I doing something wrong?

Yes.  It's probably one or more of the following:

	1. You got an error message that you didn't understand, but
	   you didn't look it up in the `perldiag' manual page.

	2. You turned on the `strict refs' safety feature without
	   knowing what it was for.

	3. You can an error message about `strict refs' and then you
	   didn't look in the `strict refs' manual page to see what
	   might have caused that error.

Here's something else you did wrong: You sent me a copy of your
article in email, without any indication that you were posting it to
the newsgroup also.  That is very annoying.

Have a look at the manuals.  If you don't understand what `strict
refs' is about you might want to have a look at
http://www.plover.com/~mjd/perl/FAQs/Reference.html.


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

Date: Sun, 8 Aug 1999 18:28:27 -0500
From: "janshadebeach" <janshadebeach@email.msn.com>
Subject: Web Perl
Message-Id: <ePMv8Wf4#GA.419@cpmsnbbsa02>

Hello Everyone, im Kyle, a 12-year-old beginner Perl Programmer. I have just
finished reading the Llama Book for the 3rd time, and i need to learn how to
program Web Perl. Does anyone have a good idea of a book that would be good
for me?

BTW, i bet im the youngest Perl programmer in ther world. Has anyone seen
anyone younger?

Thanx,
Kyle




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

Date: 8 Aug 1999 23:44:18 GMT
From: billynospam@mirror.bt.co.uk (Graham Ashton)
Subject: Re: Web Perl
Message-Id: <slrn7qs5ii.kb5.billynospam@wing.mirror.bt.co.uk>

In article <ePMv8Wf4#GA.419@cpmsnbbsa02>, janshadebeach wrote:
>
>I need to learn how to program Web Perl. Does anyone have a good idea
>of a book that would be good for me?

O'Reilly have a book about CGI scripting (which is what I think you
really mean by "Web Perl"). I've never used it myself, but I hear that
it's very good. It's often recommended by other people in this group.

  http://www.oreilly.com/catalog/cgi2/noframes.html

>BTW, i bet im the youngest Perl programmer in ther world. Has anyone
>seen anyone younger?

no, but I'll bet you're not! ;)

-- 
Graham

P.S. <billynospam@mirror.bt.co.uk> is a fully working address...


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

Date: 8 Aug 1999 17:26:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Where to find help other than perldoc and books.
Message-Id: <slrn7qs0vk.8pr.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCLXVIII September MCMXCIII in
<URL:news:MPG.121790b564763b0989e06@nntp.hpl.hp.com>:
 .. 
 .. In view of our recent (and current) metadiscussion about programming, be 
 .. it art or engineering, note that the title of this book seems to play 
 .. directly against that of Knuth's classic series, 'The Art of 
 .. Programming'.  This book deals with programming as an engineering 
 .. disciple, but applied to individuals, not to large software endeavors.  
 .. I think that is what you (James) may be looking.


\begin{pedantic}
That's 'The Art of Computer Programming'.
\end{pedantic}


Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 08 Aug 1999 18:31:37 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Where to find help other than perldoc and books.
Message-Id: <x74si9gb06.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> James A Culp III (admin@futuristic.net) wrote on MMCLXVIII September
  A> MCMXCIII in <URL:news:7okgth$ivo$1@ffx2nh3.news.uu.net>:

  A> ## 
  A> ## However in my previous post "style" was probably the wrong word.  I need
  A> ## assistance with questions like:
  A> ## 
  A> ## "Should I make this script a bunch of sub-routines or just run it straight
  A> ## through?"


<abigail, you fun quoting style breaks emacs justify code. it can handle
levels of quoted indents except for yours.>

  A> The answer is "that depends".

  A> I've written Perl programs of 2000+ lines with only a relative small
  A> number of subroutines. If the program doesn't have a basic loop, but
  A> is just "do this, then do that, then do the other thing, then do just
  A> something, and finally, pay the bill", and all parts are important
  A> to understand the flow of the program, I do not bother too much with
  A> subroutines. Only minor sub-tasks get split off. IMO, that makes the
  A> program more readable.

i would still break that up into subs. i don't like having to scan 2000
lines of linear code no matter how simple it is. unless i have a reason
(short program or soemthing else), i like the main line code to almost
only call subs. of course this can vary with the phase of the moon. i
have many rpograms where many subs are only called once per run but that
makes for better readability and easier debugging.

  A> ## Usenet client for my linux machine working. So I'm stuck with this MS
  A> ## garbage.

  A> *boggle* I've yet to see any Usenet client on Linux that wraps lines.
                                                             ^
did you skip the word "doesn't" there?

and you really seem to like the game boggle!

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 8 Aug 1999 18:06:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Where to find help other than perldoc and books.
Message-Id: <slrn7qs3a6.8pr.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCLXVIII September MCMXCIII in
<URL:news:x74si9gb06.fsf@home.sysarch.com>:
@@ >>>>> "A" == Abigail  <abigail@delanet.com> writes:
@@ 
@@   A> James A Culp III (admin@futuristic.net) wrote on MMCLXVIII September
@@   A> MCMXCIII in <URL:news:7okgth$ivo$1@ffx2nh3.news.uu.net>:
@@ 
@@   A> ## 
@@   A> ## However in my previous post "style" was probably the wrong word.  I need
@@   A> ## assistance with questions like:
@@   A> ## 
@@   A> ## "Should I make this script a bunch of sub-routines or just run it straight
@@   A> ## through?"
@@ 
@@ 
@@ <abigail, you fun quoting style breaks emacs justify code. it can handle
@@ levels of quoted indents except for yours.>

Oh well. That's just too bad. ;-)

@@ 
@@   A> The answer is "that depends".
@@ 
@@   A> I've written Perl programs of 2000+ lines with only a relative small
@@   A> number of subroutines. If the program doesn't have a basic loop, but
@@   A> is just "do this, then do that, then do the other thing, then do just
@@   A> something, and finally, pay the bill", and all parts are important
@@   A> to understand the flow of the program, I do not bother too much with
@@   A> subroutines. Only minor sub-tasks get split off. IMO, that makes the
@@   A> program more readable.
@@ 
@@ i would still break that up into subs. i don't like having to scan 2000
@@ lines of linear code no matter how simple it is. unless i have a reason
@@ (short program or soemthing else), i like the main line code to almost
@@ only call subs. of course this can vary with the phase of the moon. i
@@ have many rpograms where many subs are only called once per run but that
@@ makes for better readability and easier debugging.

I don't see the advantage. Then your program becomes 2000 lines of linear
code, with a "sub sub_name {" every so often. Of course, you could put the
subs in alphabetical order, or build a hook in your editor such that the
subs get shuffled each time you save to file, but what would be the point?

I very seldomly write programs of the form:

   sub1;
   sub2;
   sub3;
   sub4;
   exit;

What's the point?

@@   A> ## Usenet client for my linux machine working. So I'm stuck with this MS
@@   A> ## garbage.
@@ 
@@   A> *boggle* I've yet to see any Usenet client on Linux that wraps lines.
@@                                                              ^
@@ did you skip the word "doesn't" there?

No. I really do mean a client that doesn't wrap lines. Unless of course
told to do so. (But I've never used a client, on any OS, for which I
bothered to look that up.) If my newsclient gets the posting back from
my editor, it better *not* have a mind of its own and throw in random
newlines. rm would be a too soft punishment.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 08 Aug 1999 23:41:46 GMT
From: txh666@my-deja.com
Subject: Win32: Window title from process id?
Message-Id: <7ol4jp$cig$1@nnrp1.deja.com>

Hi,

I'm trying to get the Window title's of all
processes running under NT. ie: the same output
as TLIST.EXE. Does anyone know if this is
possible?

thanks,
Tim..


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 423
*************************************


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