[6797] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 422 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 4 21:17:18 1997

Date: Sun, 4 May 97 18:00:20 -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           Sun, 4 May 1997     Volume: 8 Number: 422

Today's topics:
     Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-p (A. Deckers)
     Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-p (Tad McClellan)
     Re: Combining 2 GIFs in Perl? <Chris.King@swindon-fc.demon.co.uk.mars>
     Dbm, using Btrees (Steve Kohler)
     Re: explanation of contexts ?? (Chris Schleicher)
     Re: Help Use 1 file to edit another <bdispa@ctp.com>
     Re: How to do a "less" on a file. (Jordyn A. Buchanan)
     HTML embedded in a perl script <knelson@ist.ucf.edu>
     Looking for Perl-based NNTP pass-through server. (Lloyd Zusman)
     Re: Loosing clpm regulars (was Re: Perl auto-replier) (Steffen Beyer)
     Need file info for perl script <jverb@iserv.net>
     opendir and mkdir in dos perl...Please Help.. <everett@msms.doe.k12.ms.us>
     Re: Perl auto-replier (Steffen Beyer)
     Re: PERL Editor <Chris.King@swindon-fc.demon.co.uk.mars>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 May 1997 16:04:49 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
Message-Id: <slrn5mmoh1.o5j.I-hate-cyber-promo@news.rediris.es>

[snipped alt.fan.e-t-b, is that OK? Don't know what the "polite" thing
to do is.]

In comp.lang.perl.misc,alt.fan.e-t-b,
	usenet-tag@qz.little-neck.ny.us wrote:

>A.Deckers <I-hate-cyber-promo@man.ac.uk> wrote:
[...]
>>That's one of the roles that I envisage for the moderation panel:
>>deciding on the best technical approach the script should implement to
>>meet the criteria set out in the charter.
>
>So I guess it is going to be a perl script, huh? :^)

No way! Perl sucks. I'm going to contract out the job to the
comp.lang.java people. ;-)

Alain



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

Date: Sat, 3 May 1997 15:37:06 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
Message-Id: <il7gk5.o42.ln@localhost>

A.Deckers (I-hate-cyber-promo@man.ac.uk) wrote:
: In comp.lang.perl.misc,
: 	tadmc@flash.net wrote:
: >
: >A. Deckers (I-hate-cyber-promo@man.ac.uk) wrote:
: >
: >[ snip ]
: >
: >: + that contains more quoted than unquoted text. This condition
: >:   will not be applied to articles containing less than 20 lines
: >:   of body text, excluding the signature if one is found. Articles
: >:   without any unquoted text, not taking into account the
: >:   signature if one is present, will be rejected;
: >
: >I don't like this one. I can easily envision going on for many lines
: >with current code and an English description, and getting six
: >lines of code as an answer.

: I've ammended the next draft of the RFD to the effect that any post of
: less than 40 lines of body text will not be subject to this provision.
: Would that satisfy you? I understand your objection, but I think some
: sort of limit has to be imposed. The question is where one draws the
: line.


That sounds fine to me.


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


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

Date: Sat, 3 May 1997 12:29:11 +0100
From: Chris King <Chris.King@swindon-fc.demon.co.uk.mars>
Subject: Re: Combining 2 GIFs in Perl?
Message-Id: <OfnNPEAHGyazEwFQ@swindon-fc.demon.co.uk>

On Fri, 2 May 1997 at 09:15:02 in article <galfano-0205970915020001@164.
67.58.21>, Steven Galfano <galfano@ucla.edu> writes

>(I am running PERL on WinNT 4.0) 

Ah. Here's the Perl connection.

>I have 5 images - a background, and possible five layers to go on top. I
>would like  to let the user decide which layers to see on top of the
>background, and then give the the customized output...
>
>I was hoping (although I knew it wouldn't be that easy) that I could just
>print one GIF file after the other (see my loser code below). Nope -
>didn't work.
>
>Anyone know a way of conquering this? Are GIFs combinable?

Posibly asking in a more relevant newsgroup you may find the answer to
your question:

comp.infosystems.www.authoring.cgi and
comp.infosystems.www.authoring.images immediately spring to mind.
-- 
Chris King
The similarity of any fact mentioned within this post and
any in reality, living or dead, is purely coincidental.
Remove 'mars' from address when replying. I hate spam.
I like corned beef though.


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

Date: 3 May 1997 19:53:32 GMT
From: skohler@mindspring.com (Steve Kohler)
Subject: Dbm, using Btrees
Message-Id: <5kg53s$q7o@camel3.mindspring.com>


I need some help in finding references on using
btree dbm files.  If you know where I should start,
your help is greatly appreciated.

Steve Kohler



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

Date: 3 May 1997 11:43:56 -0700
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Re: explanation of contexts ??
Message-Id: <5kg11c$bvr@psychotix.cs.uoregon.edu>

In article <01bc56a4$f348efc0$748e4dcf@frenomulax>,
arnie sherman <arnie@diac.com> wrote:
>could anyone point out an online source (faq, web page?) for a concise
>explanation of contexts (i.e. scalar & array) for a perl newbie (me).

The place to start is 

    http://www.perl.com/perl/info/documentation.html

which contains FAQs, Manpages (for 5.003 and now 5.004beta as well), and
much more.  For information on contexts, see

    http://www.perl.com/CPAN/doc/manual/html/pod/perldata.html

which talks about data types and contexts.


Hope this helps,

--Chris
-- 
     Chris Schleicher                      Office:  541/346-3998
     Univ of Oregon CIS GTF                email: chrissch@cs.uoregon.edu
                URL: http://www.cs.uoregon.edu/~chrissch/


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

Date: Sun, 04 May 1997 00:39:58 -0500
From: BD <bdispa@ctp.com>
To: mhammer@execpc.com
Subject: Re: Help Use 1 file to edit another
Message-Id: <336C212E.5768@ctp.com>

Try something like :

cat file1 file2 | sort |awk '{FS="|";if($1 != prev1 || $2 != prev2)
print $0; prev1 = $1; prev2 = $2}' > file3

The idea is to merge 2 files, sort the 2 files, and use awk to get rid
of the duplicates. Check out the awk documentation. The idea is to
split  record into fields using "|" as field seperator and when field 1
($1) and field 2 ($2) are equal to the previous read record, ignore this
line otherwise print the line ($0 is whole line).

Good luck,

BD


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

Date: Sat, 03 May 1997 20:40:32 -0400
From: jordyn@bestweb.net (Jordyn A. Buchanan)
Subject: Re: How to do a "less" on a file.
Message-Id: <jordyn-ya02408000R0305972040320001@nntp.bestweb.net>

johnliao@cs.buffalo.edu (John Liao) wrote:

> open (FILE, "hugefile")||die "cant open";
> while (<FILE>){
>         print $_;
> }
> close FILE;
> 
> Now if the "hugefile" is like 2 thousand lines long,
> it'll just scroll by the screen. Is there a way in perl
> to do a "less" or "more" on the output. I have try the 
> following, but it didnt work.
> 
> open (FILE, "hugefile")|| die "can't open";
> open (OUTPUT, "less |");
> while (<FILE>){
>         print OUTPUT $_;
> }
> close FILE;

There are a couple of problems with the approach above:
    1.  less only prints things out one page at a time when
        it is printing directly to a terminal--if you redirect
        its output (as you do above), it simply dumps all the
        output.  It's a bit much to expect the other end of the
        pipe to send back "space" characters or whatever to
        continue to the next "screen".  (How big is a screen in
        a pipe?)  If you think carefully about what your program
        is doing, it's printing everything less hands off to it,
        and certainly not waiting for the user to press any keys.

    2.  Even if your approach would work, it would be a waste of
        resources.  Essentially you're having perl open a file, 
        direct its conents into a pipe to less, taking the output
        of less back into perl, and ultimately printing it there.
        Why not just have less do it all?

I suppose the following would do what you want:

   system("less hugefile");

But that makes your perl program pretty superfluous.  You could also create
your own paging routine, but that's re-inventing the wheel.

Programs like less exist for the purpose of handling data from other
programs.  The logical thing seems to be to not worry about how your data
looks, dump it to STDOUT and allow people to use less or more or whatever
they want to look at it.

Jordyn

|---------------------------------------------------------------|
|Jordyn A. Buchanan                           jordyn@bestweb.net|
|Bestweb Corporation                      http://www.bestweb.net|
|Senior System Administrator                     +1.914.271.4500|
|---------------------------------------------------------------|


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

Date: Sat, 03 May 1997 14:41:14 -0500
From: Kent Nelson <knelson@ist.ucf.edu>
Subject: HTML embedded in a perl script
Message-Id: <336B86CA.7266@ist.ucf.edu>

Hello,

I am working in a UNIX environment and have imbedded an HTML 
page in a perl script.  The page uses the <frameset> tag to
reference two other pages:  one page is located in my public
HTML directory the other page is imbedded in a perl script
located in the same cgi-bin directory as the calling script.

For some reason, the HTML page embedded in the calling script 
is unable to call or reference, with the <frameset> tag, the 
other two pages.  In other words, no frames are being displayed.
The same exact <frameset> code works fine if I use it in a static
HTML page in my public HTML directory.  I have played around with
permissions, but that doesn't seem to be the problem.  I would greatly
appreciate any help.

Kent Nelson
knelson@ist.ucf.edu
or
ken89457@pegasus.cc.ucf.edu


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

Date: 3 May 1997 16:10:05 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Looking for Perl-based NNTP pass-through server.
Message-Id: <slrn5mmork.2a4.ljz@sunspot.tiac.net>

I'm looking for a Perl utility which I can use as a pass-though server
(or a "proxy server") for NNTP.  I want to start this utility up to
listen on a port of my choice and to respond to connections and
commands.  Whatever commands get sent through this port to this
utility would then be passed to a local NNTP server, and whatever
results the local NNTP server returns in response to these commands
would then be sent back out to the client connected to the port.

I have looked in CPAN, and I haven't found anything like this,
although I vaguely remember coming across something like this in the
past.

Obviously, a generic TCP/IP pass-through server (i.e.,
non-NNTP-specific) would do the job just fine.

Thanks in advance.


-- 
Lloyd Zusman    	01234567 <-- The world famous Indent-o-Meter.
ljz@asfast.com          ^	     Indent or be indented.


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

Date: 3 May 1997 14:47:31 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <5kfj63$ij5$1@en1.engelschall.com>


[Cc: to Tom Christiansen]

A. Deckers <I-hate-cyber-promo@man.ac.uk> wrote:

> >Tom Christiansen  <tchrist@mox.perl.com> wrote:
> >>
> >>When >90% of anything you read is dreck, you tire of suffering
> >>fools gladly.  This newsgroup is no longer worth wasting time
> >>reading, or contributing to.  

I'm also annoyed by the high noise-to-signal ratio in this newsgroup,
and not just since yesterday.

When I started learning and using Perl (4.036) about two years ago,
I was glad to have this newsgroup to learn many tricks from.

But soon I outgrew most of it, and the more I learned about Perl, the
more I got tired of the highly repetitious "newbie" questions which
are all contained in the FAQ now.

Maybe two years ago the answers weren't in the FAQ, especially since
then it was Perl 4.036 time and the transition to Perl 5 was sometimes
difficult for people.

So I think that people who don't read the FAQ, who don't read anything
about netiquette, who don't even think about how newsgroups work (most
of netiquette is just common sense, you don't necessarily need to read
it, you can find it out thinking about it by yourself!) are behaving
in a highly disrespectful manner, they are acting in the purest possible
egoistic way: I don't care about you, give me what I want!

My first reaction to this (about one and a half year ago) was to stop
reading the newsgroup.

Fortunately, little after that came comp.lang.perl.modules which I read
on a regularly basis ever since (although many mispostings are also
annoying there).

In the long run, simply ignoring c.l.p.misc proved to be the wrong option:
Sometimes there are questions about my modules or questions about "how do
I do ..." which my modules were written to answer, so I started reading
this newsgroup again on a regular basis about 4 months ago.

My current way of handling the whole issue now is that I search for certain
keywords which are of interest to me (such as "date", "day", "week", etc.)
(I don't use a killfile because even people who have posted a silly question
once may ask something interesting in the future), and then I browse through
the subjects RAPIDLY (about 10 seconds per page with 20 subject lines), and
I only read articles whose subjects "jump" into my eyes because of some
familiar words in it.

(The number of those possibly interesting keywords is much too large to write
down explicitly, so I don't use the keywords feature of my newsreader)

This is a way to let your subconsciousness react to words which are of
interest to you, and it works astonishingly well.

>From the subject lines that catch my attention, I read those that sound
really promising, and I might also answer to a couple of those that I read.

So why did I explain all this in such detail?

I just wanted to show that simply staying away from this newsgroup is no
solution, and that alternatives exist.

Tom, I admire your staying-power and patience in answering so many simple
questions (to say the least :-) ), and even if sometimes you were at an
end with your nerves and posted a sarcastic response, you have nevertheless
always given or pointed to the solution.

It is even more admirable because you don't get paid for it and because you
have to work for a living at the same time.

There are people having jobs for instance at the university who can deal
with Perl on a semi-official or even official basis as part of their jobs.

But you're not one of those fortunates, you have to work hard and long to
earn your living, because you're not an employee with a fixed salary but
a self-employed person.

I don't know wether you people out there (mainly students, I guess?) know
and appreciate the fact that employees normally have a *lot* of work to do,
show me the one (we're talking about the Computer Business field here, in
other fields I don't know) with only 40 hours a week!

There is a lot of over-time work out there...

So it's not easy for those people to deal with Perl just for fun in their
spare time.

But the situation for self-employed is much worse: they almost have *no*
spare time whatsoever!

I really don't understand where Tom takes all this time from to answer so
many postings in this newsgroup!!!

He must not be getting very much sleep, I suppose...

Dear Tom, please don't go away completely!

Of course the situation has become unbearable for you. Nobody denies this
fact. But there are other solutions than this radical one!

You don't need to answer so many silly questions.

It does you no good. It does no good to the people you answer to.
And it does no good to the people who have non-trivial questions.

There are postings like the FAQ and "how to make the most out of ..."
to take care of the people with trivial questions.

Read the postings which are interesting to *you*. Answer the questions
that are not covered neither in the FAQ, nor the man pages or the Camel book.
Just those. And only if you want. And if you have the time.

I think that by answering all those silly questions you are involuntarily
giving incentive to these people to stop thinking for themselves and not to
look into the FAQ, the man pages, etc.

Because they will only start thinking (if at all, >;-) ) when they see that
their question has not been answered by anyone!

> >>It got to be too much for him.  When something's too much for him,
> >>he bails.  I, on the other hand, got pissy and tried to stick with it.
> >>I was wrong, twice, but I'm through with those mistakes.  I go now to
> >>join Larry in that great Perl heaven far removed from Usenet.

As I tried to show, there are less radical solutions, which also don't
have this taste of an offended child going to his sulking-corner... :-)

> If we've lost Tom, this group has just taken a big hit in terms of
> quality. Though I occasionally got pissed off by the silly fights he
> chose to pick in clpm, he is IMHO the kind of person that makes a
> newsgroup a usefull resource. It saddens me greatly to see him go.

Seconded whole-heartedly.

> As some of you know, I recently published a pre-RFD for some additional
> (moderated) clp.* newsgroups.

Ooops! I missed that one. Sorry.

I think in fact that this is a great idea!!!

The only problem is: who is going to moderate them?

> I would like to know what regular readers of clpm think about adding a
> comp.lang.perl.moderated to the pre-RFD. As I doubt we could find
> enough human moderators willing to take on the job, I propose an
> auto-moderated group.  Articles would have to include a "magic cookie"
> in a given header in order to be passed by the moderation script. IMHO,
> this should cut down the noise level to almost zero, as anyone who
> reads bofh will realise.

Ah, okay, that could work.

But where would you hide the magic cookie? In the FAQ? In the man pages?

Please don't make me re-read all that (because most of it is already in
my mind!) just to find that key which gives me permission to the newsgroup!

Another guy in this thread (sorry, I didn't memorize your name!) had a great
idea too: Why not create a newsgroup called "comp.lang.perl.wizards" to
attract all the people who go for glitter away from the newsgroups
where the non-trivial issues are discussed?

But I suppose Netiquette wouldn't allow such a big bluff...

> What do you think? Perhaps if we can create a group with a high signal to
> noise ration, we can bring back some of the people like Tom, and who
> knows, maybe Larry, who make these newsgroups really worthwhile.

Hopefully!

Let's do it!

> Cheers,
> Alain

Truly yours,
-- 
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
   ############################################################
   # "There is enough for the need of everyone in this world, #
   #  but not for the greed of everyone." - Mahatma Gandhi    #
   ############################################################


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

Date: Sat, 03 May 1997 22:08:55 -0400
From: John Verbrugge <jverb@iserv.net>
Subject: Need file info for perl script
Message-Id: <336BEFB6.29E5@iserv.net>

Does anyone know of any other file information I can get using Perl
besides "ls -l" and the stat() command?

I'm trying to write a "super ls" program, but I need more info than
stat gives.

Thanks.

Sherrill
peichih@juno.com


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

Date: Sat, 03 May 1997 12:08:35 -0500
From: Chris Everett <everett@msms.doe.k12.ms.us>
Subject: opendir and mkdir in dos perl...Please Help..
Message-Id: <336B7113.405B@msms.doe.k12.ms.us>

I am having a problem with a script that i am writing in dos perl. 
Opendir always returns a true whether the dir is there or not, so i can
not test for the dir to mk it if it is not there.  Any ideas here?  Also
mkdir does not work, it just doesn't make anything.  Any ideas?

Thanks in advance.
chris everett


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

Date: 3 May 1997 15:44:27 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Perl auto-replier
Message-Id: <5kfmgr$m0u$1@en1.engelschall.com>

Randal Schwartz <merlyn@stonehenge.com> wrote:

> Well, for what it's worth, *I'm* still here, but I count on others to
> send away the CGI questions so that I don't have to get riled up.

Ah, I don't think we will be able to send them away if the people asking them
refuse to read postings like the FAQ and "how to make the most out of ...".

Even sending them these postings via email will probably not dissuade
them...

But I think you should be able to simply ignore these questions if they don't
interest you.

I think that these people are probably posting their question to several
newsgroups at the same time anyway in order to maximize their chances of
getting an answer.

Well, people in a newsgroup which is expressively devoted to Perl alone
are not obliged to answer them...

Yours,
--
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
     "There is enough for the need of everyone in this world,
      but not for the greed of everyone." - Mahatma Gandhi
   >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: Sat, 3 May 1997 12:17:34 +0100
From: Chris King <Chris.King@swindon-fc.demon.co.uk.mars>
Subject: Re: PERL Editor
Message-Id: <yMlyrAAO7xazEwTH@swindon-fc.demon.co.uk>

On Sat, 3 May 1997 at 02:42:51 in article <5ke8nb$ufj@news.microsoft.com
>, Nicholas Carey <a-bnc@microsoft.com> writes
>In article <5kdhii$q64@info.abdn.ac.uk>, junkmail@sysc.abdn.ac.uk says...
>>
>>Luigi Mattera, while sobering up, wrote:
>>: Peter G. Martin (peterm@zeta.org.au) wrote:
>>: : emacs.pl, potatoes, vi, ed....
>>: : So none of you own a pencil, huh ?
>>
>>:   Pencils?  Bah, who needs pencils?  You should manually punch out
>>: holes in punch cards to feed into a punch card reader.
>>
>>All that card? I only need 8 switches and a button to input *my* programs.
>
>switches? really? I use wire jumpers ;-)

Never tried moving the little particles around on your hard drive with a
small magnet and a microscope? Obviously you can dispense with the
microscope once you're used to it.
-- 
Chris King
The similarity of any fact mentioned within this post and
any in reality, living or dead, is purely coincidental.
Remove 'mars' from address when replying. I hate spam.
I like corned beef though.


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

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

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