[9344] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2939 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 22 22:07:26 1998

Date: Mon, 22 Jun 98 19:00:27 -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           Mon, 22 Jun 1998     Volume: 8 Number: 2939

Today's topics:
    Re: "Code-checker" for Perl. (Martien Verbruggen)
    Re: -f option in perldoc (Martien Verbruggen)
        after 5 hrs, the beginner beats the s/// <REPLY_TO_damonbrent@earthlink.net>
    Re: after 5 hrs, the beginner beats the s/// <REPLY_TO_damonbrent@earthlink.net>
    Re: Binmode <rootbeer@teleport.com>
    Re: first language (Paul Buder)
    Re: Flames.... birgitt@my-dejanews.com
    Re: Flames.... (Michael J Gebis)
    Re: Flames.... birgitt@my-dejanews.com
    Re: Flames.... (Ronald J Kimball)
    Re: Flames.... <tchrist@mox.perl.com>
    Re: Flames.... <rootbeer@teleport.com>
        information on using shared memory with Perl (Brian Soderblom)
    Re: Key exists (Ronald J Kimball)
        More Complete Delete Example <luckys@geocities.com>
    Re: New to perl..stupid questions on arrays and memory <rootbeer@teleport.com>
        Pat space doesn't change in nested whiles (John Yates)
    Re: Pat space doesn't change in nested whiles <rootbeer@teleport.com>
    Re: print and the . operator ?? (Martien Verbruggen)
    Re: Problem with space in front of each line of text. <info@purco.qc.ca>
    Re: Sending files via mail in perl (Paul J. Schinder)
    Re: Sending files via mail in perl <zenin@bawdycaste.org>
    Re: sendmail problems <zenin@bawdycaste.org>
    Re: Spider programms in PERL (John Armsby)
    Re: Warnings from environment variables under -w <rootbeer@teleport.com>
        Writing Perl extensions in languages other than C/C++ <jhague@dadgum.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 22 Jun 1998 23:21:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: "Code-checker" for Perl.
Message-Id: <6mmou6$k8c$2@comdyn.comdyn.com.au>

[Changed Newsgroups. This is not appropriate for clp.modules]

In article <358E6D83.F357B14C@telegraafnet.nl>,
	Jan Bessels <j.bessels@telegraafnet.nl> writes:
> Hi Guys/Galls

Suppose this is just a typo? :)

> The department I work is looking for a tool to standardize the look and
> Feel of the Perls scripts. They want to standardize indentation of
> constructs, naming conventions etc etc. I believe "Code-checker" for C

# perldoc perlfaq3
     perlfaq3 - Programming Tools
[snip]
     Is there a pretty-printer (formatter) for Perl?
[snip]

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: 23 Jun 1998 00:08:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: -f option in perldoc
Message-Id: <6mmrmr$ki8$1@comdyn.comdyn.com.au>

In article <358EA3B1.1DA4F4C9@matrox.com>,
	Ala Qumsieh <aqumsieh@matrox.com> writes:

> Why don't I have the -f option? Do I have an obsolete version of
> perldoc?

Probably. perldoc got the -f option in perl 5.004 if I remember
correctly.  It might even have been a little later version. 

You can either get and install a newer version of perl, or just
get the perldoc script from the sources.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In the fight between you and the world,
Commercial Dynamics Pty. Ltd.       | back the world - Franz Kafka
NSW, Australia                      | 


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

Date: Mon, 22 Jun 1998 20:52:05 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: after 5 hrs, the beginner beats the s///
Message-Id: <6mmu8h$jhn$1@ecuador.it.earthlink.net>

This is a multi-part message in MIME format.

------=_NextPart_000_0044_01BD9E1F.9D5F86A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

sorry for wasting the space and time, but i had to celebrate my victory =
over ONE silly line of code.  i just spent about 5 hours trying to get =
ONE line of code to do what i needed it to.  i needed to get rid of any  =
\s  characters at the beginning and end of a $line which needed  \s  =
chars in the middle ( the line was read from an html page that =
eventually is placed in a text box to be edited...just a broswer based =
web-page editor, but a more powerful one than is otherwise =
available...), so i tried about a million different  s///  lines, but =
none would work on BOTH ends of the $line.  i ended up with the =
following line and a bald spot on the side of my head:

$line =3D~ s/^\s+(?=3D\S*) | *\s*$//g;

ok, this line works great, but i'd like a line that was a little easier =
to understand--being that i am new at this and simple lines are a =
godsend to the learning process.  is there a more 'clear' way of =
performing this task?

thanks for reading my little story.  i won ---- kind of...

brent

"ok, so i am ignorant...now i'm free to learn!"



------=_NextPart_000_0044_01BD9E1F.9D5F86A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3007.2"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 face=3DArial><FONT size=3D3>sorry for wasting =
the space and=20
time, but i had to celebrate my victory over ONE silly line of =
code.&nbsp; i=20
just spent about 5 hours trying to get ONE line of code to do what i =
needed it=20
to.&nbsp; i needed to get rid of any&nbsp; \s&nbsp; characters at the =
beginning=20
and end of a $line which needed&nbsp; \s&nbsp; chars in the middle ( the =
line=20
was read from an html page that eventually is placed in a text box to be =

edited...just a broswer based web-page editor, but a more powerful one =
than is=20
otherwise available...), so i tried about a million different&nbsp; =
s///&nbsp;=20
lines, but none would work on BOTH ends of the $line.&nbsp; i ended up =
with the=20
following line and a bald spot on the side of my =
head:</FONT></FONT><FONT=20
size=3D3></FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial><FONT =
size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 face=3DArial><FONT size=3D3>$line =3D~ =
s/^\s+(?=3D\S*) |=20
*\s*$//g;</FONT></FONT><FONT size=3D3></FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial><FONT =
size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT size=3D3>ok, this line works great, but =
i'd like a=20
line that was a little easier to understand--being that i am new at this =
and=20
simple lines are a godsend to the learning process.&nbsp; is there a =
more=20
'clear' way of performing this task?</FONT></FONT><FONT =
size=3D3></FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial><FONT =
size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT size=3D3>thanks for reading my little =
story.&nbsp; i=20
won ---- kind of...</FONT></FONT><FONT size=3D3></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT size=3D3>brent</FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>&quot;ok, so i am ignorant...now i'm free to=20
learn!&quot;</FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0044_01BD9E1F.9D5F86A0--



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

Date: Mon, 22 Jun 1998 21:03:52 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: Re: after 5 hrs, the beginner beats the s///
Message-Id: <6mmuuj$kmn$1@ecuador.it.earthlink.net>

This is a multi-part message in MIME format.

------=_NextPart_000_0057_01BD9E21.429C70A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hmm...well i feel dummer now...

$line =3D~ s/^\s* | *\s*$//g;

does the same thing and looks nicer.

oh well,

brent

    Brent Verner wrote in message =
<6mmu8h$jhn$1@ecuador.it.earthlink.net>...
    sorry for wasting the space and time, but i had to celebrate my =
victory over ONE silly line of code.  i just spent about 5 hours trying =
to get ONE line of code to do what i needed it to.  i needed to get rid =
of any  \s  characters at the beginning and end of a $line which needed  =
\s  chars in the middle ( the line was read from an html page that =
eventually is placed in a text box to be edited...just a broswer based =
web-page editor, but a more powerful one than is otherwise =
available...), so i tried about a million different  s///  lines, but =
none would work on BOTH ends of the $line.  i ended up with the =
following line and a bald spot on the side of my head:
    =20
    $line =3D~ s/^\s+(?=3D\S*) | *\s*$//g;
    =20
    ok, this line works great, but i'd like a line that was a little =
easier to understand--being that i am new at this and simple lines are a =
godsend to the learning process.  is there a more 'clear' way of =
performing this task?
    =20
    thanks for reading my little story.  i won ---- kind of...
    =20
    brent
    =20
    "ok, so i am ignorant...now i'm free to learn!"
    =20


------=_NextPart_000_0057_01BD9E21.429C70A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN">
<META content=3D'"MSHTML 4.72.3007.2"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 face=3DArial size=3D2>hmm...well i feel =
dummer=20
now...</FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT color=3D#000000 face=3DArial><FONT size=3D3>$line =3D~ s/^\s* =
|=20
*\s*$//g;</FONT></FONT></DIV>
<DIV><FONT color=3D#000000 face=3DArial><FONT =
size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>does the same thing and looks =
nicer.</FONT></DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>oh well,</FONT></DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>brent</FONT></DIV></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
    <DIV>Brent Verner<REPLY_TO_DAMONBRENT@EARTHLINK.NET> wrote in =
message &lt;<A=20
    =
href=3D"mailto:6mmu8h$jhn$1@ecuador.it.earthlink.net">6mmu8h$jhn$1@ecuado=
r.it.earthlink.net</A>&gt;...</DIV>
    <DIV><FONT color=3D#000000 face=3DArial><FONT size=3D3>sorry for =
wasting the space=20
    and time, but i had to celebrate my victory over ONE silly line of=20
    code.&nbsp; i just spent about 5 hours trying to get ONE line of =
code to do=20
    what i needed it to.&nbsp; i needed to get rid of any&nbsp; \s&nbsp; =

    characters at the beginning and end of a $line which needed&nbsp; =
\s&nbsp;=20
    chars in the middle ( the line was read from an html page that =
eventually is=20
    placed in a text box to be edited...just a broswer based web-page =
editor,=20
    but a more powerful one than is otherwise available...), so i tried =
about a=20
    million different&nbsp; s///&nbsp; lines, but none would work on =
BOTH ends=20
    of the $line.&nbsp; i ended up with the following line and a bald =
spot on=20
    the side of my head:</FONT></FONT><FONT size=3D3></FONT></DIV>
    <DIV><FONT color=3D#000000 face=3DArial><FONT =
size=3D3></FONT></FONT><FONT=20
    size=3D3></FONT>&nbsp;</DIV>
    <DIV><FONT color=3D#000000 face=3DArial><FONT size=3D3>$line =3D~ =
s/^\s+(?=3D\S*) |=20
    *\s*$//g;</FONT></FONT><FONT size=3D3></FONT></DIV>
    <DIV><FONT color=3D#000000 face=3DArial><FONT =
size=3D3></FONT></FONT><FONT=20
    size=3D3></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial><FONT size=3D3>ok, this line works great, =
but i'd like a=20
    line that was a little easier to understand--being that i am new at =
this and=20
    simple lines are a godsend to the learning process.&nbsp; is there a =
more=20
    'clear' way of performing this task?</FONT></FONT><FONT =
size=3D3></FONT></DIV>
    <DIV><FONT color=3D#000000 face=3DArial><FONT =
size=3D3></FONT></FONT><FONT=20
    size=3D3></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial><FONT size=3D3>thanks for reading my little =
story.&nbsp;=20
    i won ---- kind of...</FONT></FONT><FONT size=3D3></FONT></DIV>
    <DIV><FONT face=3DArial><FONT size=3D3></FONT></FONT><FONT=20
    size=3D3></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial><FONT size=3D3>brent</FONT></FONT></DIV>
    <DIV><FONT face=3DArial><FONT size=3D3></FONT></FONT><FONT=20
    size=3D3></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial>&quot;ok, so i am ignorant...now i'm free to =

    learn!&quot;</FONT></DIV>
    <DIV><FONT face=3DArial><FONT size=3D3></FONT></FONT><FONT=20
    size=3D3></FONT>&nbsp;</DIV>
    <DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0057_01BD9E21.429C70A0--



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

Date: Mon, 22 Jun 1998 23:49:41 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Binmode
Message-Id: <Pine.GSO.3.96.980622164015.3398K-100000@user2.teleport.com>

On 22 Jun 1998, Mark Morgan Lloyd  wrote:

> If I'm doing this:
> 
>   while (<STDIN>) {
> 
> ...or this:
> 
>   while (<>) {
> 
> How do I use binmode on a DOS file? 

Both of those are using the line-input operator to read a line at a time. 
Of course, a file with lines of text is a text file - you don't want to
use binmode on that! 

> The problem is that I've got a simple script to get rid of embedded
> nulls in a text file which is getting messed up by DOS Perl's default
> handling of \r\n. 

binmode won't tamper with nulls; it signals that you're working with a
binary file, not a text file, and that therefore no translation to "\n"
(newline character) should be performed. (It also keeps the DOS
end-of-text character from being interpreted.) 

It sounds as if you may need to process some damaged text in some other
ways. I'd guess that the tr/// operator, as the first line inside your
while loop, could help. If that's not it, you may need to explicitly open
the file (rather than finding it on STDIN or auto-opened via the diamond
operator) and use binmode before reading. Then you'll need to manually
perform any operations needed to make it a proper DOS text file.

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 22:37:00 GMT
From: paulb@user1.teleport.com (Paul Buder)
Subject: Re: first language
Message-Id: <6mmma7$bgc$1@user1.teleport.com>

In <6mlctf$vam$1@nnrp1.dejanews.com> raw@cs.wisc.edu writes:

>"The case like this" was concerned with an early stage of learning: in C,
>you must either supply non-standard input routines (which must at
>some point be unlearned) or use scanf (with an explanation of pointers
>in order to understand &, or with no explanation at all).  The best option

All this talk of scanf.  I hope you people don't actually use that
horrid function in your C code.  Can you say buffer overflow?  fgets
and fread take a little more work sometimes but at least you can
control the size of things getting put into your variables.



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

Date: Tue, 23 Jun 1998 00:11:20 GMT
From: birgitt@my-dejanews.com
Subject: Re: Flames....
Message-Id: <6mmrr8$l5j$1@nnrp1.dejanews.com>

In article <Pine.GSO.3.96.980622052808.6310N-100000@user2.teleport.com>,
  Tom Phoenix <rootbeer@teleport.com> wrote:
>
> I believe that you're saying that we can't conclude that the person who
> hasn't read in the past would never read your proposed postings in the
> future. Agreed. But my question is, why _would_ the person who hasn't read
> postings in the past suddenly decide to read your proposed postings?
>
> Posting a message telling people to read is like the Flight Attendant
> announcing that "passengers must obey the instructions of the Flight
> Crew". If the passengers aren't intending to obey instructions, why
> would they decide to obey that one?



Because you don't deal with scared passengers who don't want to
get a bump on their head during the next flight turbulence and are
actually very willing to obey the instructions of the Flight Crew.

You are dealing with very eager nineth graders who want to go
to a very cool college and learn very cool skills to get a very cool
job. These folks are just about to discover that the reading list
for their entrance exam they have to pass in a couple of years is
actually *very* long and the questions *quite tough*.

But then there is this free tutoring group who provides cliff notes,
they have heard. They come and ask and look for a *shortcut* and
they want that shortcut pretty desperately, because they already
suspect without these shortcuts they will never make it through
the exam.

They didn't think about the fact that "there are no shortcuts in life",
and are obviously not in a great mood to get reminded. So they might
just prefer to deny that and pretend haven't heard about it. Therefore
they are not prepared for your "reading instructions to read the
actual books of the reading list" and tend to deny ever having heard
about them.

Like any 'hooked' person who is in denial about some slightly
'odd, if not compulsive' behaviour, the way to help them out
of that stage is:

1. Don't play the enabler, don't provide the shortcut.
2. Remind them daily (yes, that's needed, believe it or not)
   that their behaviour is unacceptable.
   Make it impossible to them to deny what is going on.
3. Be there, if they stay 'sober'.

That's why I think, that very explicit automated posts like

   "WHY YOU DON'T GET AN ANSWER TO YOUR QUESTION"
   "WE EXPECT YOU TO HELP YOURSELF"

on a daily basis will have an effect, especially if they are
followed up with the appropriate actions.

Your weekly posts (the automated ones) are not enough of a
"tough love" approach for this crowd.

Getting all upset and outraged and starting a long discussion
and analysis of the state of affairs doesn't help much either.

Birgitt Funk












-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 23 Jun 1998 00:23:59 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Flames....
Message-Id: <6mmsiv$sp6@mozo.cc.purdue.edu>

phenix@interpath.com (John Moreno) writes:

}But Tom snipped and didn't address what I consider a important part of
}Gebis's message, namely:

}> The faq is big.  The docset for perl is big. This is a good thing, but it
}> is not without problems.  It's hard to find stuff if you lack context.
}> Dejanews is worse -- if you don't have some good keywords, you'll end up
}> finding 200,000 seemingly random results.

}And this brings up a point which needs to be made - if you don't know
}enough about what you want to do to figure out a range of keywords or
}starting point to find what you are looking for, then you probably don't
}need a answer because you don't know enough to have a valid question
}(with a obvious exception for people who don't speak english very well).

Without getting into the finer points, I still stand by my assertion:

Answering "RTFAQ" does nobody any good.  The lazy ignore it, the truly
confused still have no context.

Answering "RTFAQ, look for XXXX" at least gives those who are truly
confused a way to narrow the search space.  The lazy probably still
ignore it, but then again, maybe that's the point.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Tue, 23 Jun 1998 00:48:14 GMT
From: birgitt@my-dejanews.com
Subject: Re: Flames....
Message-Id: <6mmu0e$o2r$1@nnrp1.dejanews.com>

In article <6mlpfl$bf2$1@rand.dimensional.com>,
  dgris@rand.dimensional.com wrote:
>
> [posted and mailed to the cited author]
> In article <6mjt6d$4ov$1@nnrp1.dejanews.com>,  <birgitt@my-dejanews.com>
wrote:
> <snip _two_ complete articles :-(>
>
> >1. The assumption that anybody who posts his first question here
> >   knows how to use a computer, has read the FAQs and some of
> >   the Perl documentation and has read c.l.p.m for at least a
> >   week is quite unrealistic.
> >
> What is `unrealistic' is the expectation among some that they can
> enter a professional gathering and expect expert training for free.

You got me wrong. It is not at all unrealistic to *expect* that the
poster to c.l.p.m  *should* know that he is not supposed to get
expert training for free. It is not unrealistic to *expect* them
to know. It is very necessary to make them understand they don't
get it.

But reality is that they don't behave according what you expect.
In that sense I meant to say that believing the would behave
according to what you expect is unrealistic.

> Come on, would you ever show up at a convention of auto mechanics screaming
> at people that you promised to fix this car, but can't figure out how to
> start it, and expect them to do it for you?  Would you accost an attorney
> and demand he write a legal brief for your client because you don't know
> how?

Did I say I would ?

>
> I consider it perfectly reasonable to expect people who are asking questions
> about programming to know how to use their computer, to have read the
> relevant documentation, and to have read a newsgroup for at least a week
> before they begin posting (actually, I expect them to have read the group
> for at least six months, more if they have no experience on Usenet).

Absolutely, what you expect is very reasonable. Did I say it's not?
I just said, apparently people don't behave the way you would expect
them to behave.

> a person hasn't done these things then that person shouldn't post.  If
> they do post, they deserve what they get.  I'd never enter into an
> unfamiliar culture without taking the time to learn its values and
> customs, why should I put up with those with less respect for other
> people's time and energy.

You shouldn't and I didn't say so.

>
> <snip>
> >           FAQ! ANSWERS TO YOUR QUESTIONS ! READ FIRST!
> >          *daily* even *twice daily*. And I would include as many
> >           detailed pointers as you can.
> >
> The mini-faq never falls out of my news spool.  It's there for any who want
> to read it, anytime they want to read it.  Posting it more frequently
> wouldn't make it more visible.

I answered Tom Phoenix why I think this and more explicit posting
would have an effect.


> If the flames convince others to _not_ post, then they are worth it.

Most of the newbie posters deserve to be ignored and expected to
behave in a way which should be made *very explicitly clear* in
impersonal frequently, automated posts. A couple of stubbern
or very fresh newbies, who complain, deserve a flame, which then
actually produces quite a noisy thread til you get them 'convinced'.

> If the programmers are perceived as a bunch of unhelpful people who
> scream at newbies, well, at least the newbies will go away (perhaps
> back to lurker land until they know how to program).

That is an assumption you make of which I don't know where you got
it from. Did I voice such a thing in my post ?

>
> >Especially as very often the assumed 'sinfulness' of the newbie
> >can't fairly be known. You might hurt a lot of feelings for nothing.
> >And you say yourself that this approach is also not very successful.
> >
> No, it seems extraordinarily successful to me.

Really, how come that the newbies don't stop asking FAQ questions
then ?

> The non-programmers go away after a couple of flames, leaving
> the rest of us to discuss things productively.

I would rather say they would go away immediately if they would
be ignored, thus saving the rest of us to be distracted by flame
exchanges.


> If the feelings of someone who hasn't bothered to learn
> how to properly conduct himself are hurt, so be it.
>

Sure, but one could be more efficient and less noisy in making
people to conduct more appropriately.

> >One cannot *help* someone to read something and one cannot *help*
> >someone to *help himself*.
> >
> No, but one has no responsibility to coddle these so called _programmers_
> and to perform their jobs for them.

Nobody said that, at least not me. Or can you quote me doing so ?

Birgitt Funk


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Mon, 22 Jun 1998 21:02:24 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Flames....
Message-Id: <1db1ld2.1xlhzjoutnd8cN@bay1-172.quincy.ziplink.net>

Chris Miller <apminc@cvn.net> wrote:

> It seems that newbies are comparable to flies around here.  You tolerate
> them for awhile but you're annoyed to all hell by them.  Lighten up a bit.
> Don't respond if you don't want to be bothered.

If your house is infested with flies, don't pay any attention to them.
They'll go away.  Really.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 23 Jun 1998 01:44:32 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Flames....
Message-Id: <6mn1a0$hlf$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, birgitt@my-dejanews.com writes many things.

I suggest that you draft you proposed daily postings regarding what
people should know.  I expect that it shall make no difference at all.

--tom
-- 
"I find this a nice feature but it is not according to the documentation.
   Or is it a BUG?"
"Let's call it an accidental feature. :-)" Larry Wall in <6909@jpl-devvax.JPL.NASA.GOV>


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

Date: Tue, 23 Jun 1998 01:54:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Flames....
Message-Id: <Pine.GSO.3.96.980622183041.3398P-100000@user2.teleport.com>

On Tue, 23 Jun 1998 birgitt@my-dejanews.com wrote:

> Like any 'hooked' person who is in denial about some slightly
> 'odd, if not compulsive' behaviour, the way to help them out
> of that stage is:
> 
> 1. Don't play the enabler, don't provide the shortcut.
> 2. Remind them daily (yes, that's needed, believe it or not)
>    that their behaviour is unacceptable.
>    Make it impossible to them to deny what is going on.
> 3. Be there, if they stay 'sober'.

Now, I believe that your suggestion was to have a daily autopost of some
information on why some posts are inappropriate. It seems that you're now
contending that this will somehow help people _after_ they've posted an
inappropriate message. Hmmm.

I'd like to make an improvement to your suggestion. Here is my thesis:

            If it would help someone to read it, 
         mailing it would be better than posting it.

Points in support:

 1. If they didn't read a posting beforehand, they won't read
    it afterwards. 

 2. Posting it weekly, daily, or hourly doesn't make it more
    likely to be read. Mailing it does.

 3. We are trying to improve the s/n ratio here, after all. Too
    frequently posting an identical document will make that worse. 

Of course, this won't reach address-mungers. For their benefit, we could
post it once per week or so. I could perhaps endorse a plan to mail some
sort of "Users' Guide to c.l.p.misc" to inappropriate posters to this
newsgroup. 

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 23:53:06 GMT
From: brian@sod*erblom.net (Brian Soderblom)
Subject: information on using shared memory with Perl
Message-Id: <3593eddf.541853260@news.verioco.com>

I'm looking for resources on using shared memory with Perl.  I
understand the book "Developing CGI Applications with Perl" has some
information on this topic.

Has anyone read this book and is the information therein useful?

Are there any other books/sources for this information?  Especially
examples?

Thanks,

-- 
Brian Soderblom
brian@sod*erblom.net
(303) 903-3346 ICQ# 4603281
remove the * to respond


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

Date: Mon, 22 Jun 1998 21:02:29 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Key exists
Message-Id: <1db1lm6.1u5dx9ww1hxc0N@bay1-172.quincy.ziplink.net>

Larry Rosler <lr@hpl.hp.com> wrote:

> In article <358D2EF3.D99E60A8@matrox.com>, Ala Qumsieh 
> <aqumsieh@matrox.com> says...
> > lhiller@compupartner-edm.com wrote:
> ...
> > > How can I check if a has has a particular key defined?
> > 
> > if (exists $hash{$key}) {
> >   # whatever
> > }
> 
> 'exists' ne 'defined'.  A bit more discussion is required.

Yes, but 'key' ne 'value'.  If the poster merely wanted to know whether
the key exists in the hash, then Ala's answer was correct.  If the
poster meant to ask whether the value of a particular key is defined,
then 'defined' would be the function to use.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 22 Jun 1998 21:57:12 -0400
From: Luckys <luckys@geocities.com>
Subject: More Complete Delete Example
Message-Id: <358F0B78.5B73@geocities.com>

I'm sorry if my previous example was a bit inaccurate.  I didn't me for
it to be a working example.  I was more interest in the use of the
delete function.

Below is a better, working example of what I'm attempting to do.  I
don't understand why it won't delete the key, value pairs from the DMB
file.


#!/usr/bin/perl

$key1 = "name1";
$value1 = "name1:\0:street_address:\0:etc";

$key2 = "name2";
$value2 = "name2:\0:street_address:\0:etc";


dbmopen(%delete, "delete", 0766);

$delete{$key1} = "$value1";
$delete{$key2} = "$value2";

dbmclose(%index);


&DEL;


# Open DBM file and delete key, value pair.

sub DEL {
dbmopen(%delete, "delete", 0766);

foreach (keys %delete) {

   delete $delete{$_};

}

dbmclose(%index);
}


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

Date: Mon, 22 Jun 1998 23:10:27 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: New to perl..stupid questions on arrays and memory
Message-Id: <Pine.GSO.3.96.980622160448.3398F-100000@user2.teleport.com>

On 22 Jun 1998, Milan Spingl wrote:

> I'm running out of memory while processing arrays of hashes containing
> data loaded by ora_fetch() (OraPerl module).

Unless you're intending to store large quantities of data in memory all at
once, it is (or should be) hard to run out of memory in Perl. Perhaps
you're accidentally saving more data than you mean to, or perhaps you've
tripped over a memory leak. Are you using 5.004? Many memory leaks were
plugged as of that version.

> Is there a slick way to ensure there is enough memory to process huge
> arrays? 

Sure; have no more than one element in memory at a time. :-)  But if you
are needing to load a huge array, you can plan on using a lot of memory -
and there's no way to do much about monitoring or controlling that in
current versions of Perl. But you could trade time for memory, and use an
array tied to a file, for example. 

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Jun 1998 23:50:21 GMT
From: def456@vcn.bc.ca (John Yates)
Subject: Pat space doesn't change in nested whiles
Message-Id: <6mmqjt$6l0@milo.vcn.bc.ca>

I'm having a problem with the pattern space in nested whiles.  The
pattern space does not change when a second while <> reads in records.
If I run this program:
---------------------
    #!/usr/bin/perl
    while (<>) {
        print "In 1st while, \$_ = $_";
            while(<> && !m/bb/) {
	        print "    In 2nd while, \$_ = $_";
            } 
    }

With this data file:
-------------------
aaa1
aaa2
aaa3
aaabb4
ccc5
ccc6
ccbbcc7

I get:
------
In 1st while, $_ = aaa1
    In 2nd while, $_ = aaa1
    In 2nd while, $_ = aaa1
    In 2nd while, $_ = aaa1
    In 2nd while, $_ = aaa1
    In 2nd while, $_ = aaa1
    In 2nd while, $_ = aaa1

The records are read in but the m// doesn't find 'bb'.
I can get around this by changing the program.

I run this program:
------------------
#!/usr/bin/perl

while (<>) {
    print "In 1st while, \$_ = $_";
    while(<>) {
        if (m/bb/) { goto OUT; }
	print "    In 2nd while, \$_ = $_";
    }
OUT:    
}

And I get this result:
---------------------
In 1st while, $_ = aaa1
    In 2nd while, $_ = aaa2
    In 2nd while, $_ = aaa3
In 1st while, $_ = ccc5
    In 2nd while, $_ = ccc6

This is what is wanted.  I am running perl version 5.004 under linux
verion 2.0.30. Is there a better way to make the pattern space ($_)
change in the second while (or make m// find bb)?

Thanx,
John Yates def456@vcn.bc.ca



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

Date: Tue, 23 Jun 1998 01:29:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Pat space doesn't change in nested whiles
Message-Id: <Pine.GSO.3.96.980622181248.3398O-100000@user2.teleport.com>

On 22 Jun 1998, John Yates wrote:

>     while (<>) {
>         print "In 1st while, \$_ = $_";
>             while(<> && !m/bb/) {

The line input operator magically assigns to $_ only in the case that
that's the sole item in the condition of the while loop. So, unless you
have that special case, it merely reads and returns one line without
affecting $_. In this case, the line, having been read, is discarded.

Having said that, I should mention that it's almost always wrong to have
the diamond operator in two places within the same program. (It can be
done correctly, but it's very often a sign of a problem in the program's
logic.) If you choose to use the diamond more than once, you should be
sure to watch out for it ever returning undef - and if it does, be certain
to not call the diamond operator again unless you know just what it will
do! 

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 22 Jun 1998 23:29:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: print and the . operator ??
Message-Id: <6mmpc8$k8c$3@comdyn.comdyn.com.au>

In article <Pine.SOL.3.91.980622123822.10113A-200000@teer2.acpub.duke.edu>,
	Seo Choi <swc4@acpub.duke.edu> writes:
>   This message is in MIME format.  The first part should be readable text,

Please don't do this. Usenet is a plain text medium. There is no place
for multipart messages here.

> foreach $student (%grades) {

I don't think you want this. I think you meant to do something
like:

foreach my $student ( keys %grades ) { }

> foreach $student (%gList) {

ditto

> from the code above I have two questions. the first is why in the line
> 	$grades{$student} .=
> behaves the same way as 
> 	$grades{$student} =	without the dot

They don't behave the same way, unless $grades{$student} is initially
empty.

Have a look at the perlop man page

# perldoc perlop

and try the following:

my $a = '';
$a .= 'something';
print "$a\n";

$a = 'something';
$a .= 'and something else';
print "$a\n";

You should think about running perl with the -w flag, and using the
strict pragma.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


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

Date: Tue, 23 Jun 1998 00:14:34 GMT
From: Leon Stepanian <info@purco.qc.ca>
Subject: Re: Problem with space in front of each line of text.
Message-Id: <358EF4E8.9D8487A9@purco.qc.ca>

>

Hi,First off, thanks for all your help which has been enough to correct
my mistake.I finally decided to simply isolate the print array fromt he
rest of the print line.

Original;
print "<TEXTAREA COLS=70 ROWS=20
name=\"c_text\">@holdfile</TEXTAREA>\n";Final;
print "<TEXTAREA COLS=70 ROWS=20 name=\"c_text\">";
print @holdfile;
print "</TEXTAREA>\n";

Now that this works OK, I'll see to refine with your other suggestions.

Apparently the problem was indeed printing an array with the " which
caused the leading space.

Thanks again, and I am very sorry to have posted my initial question
with html. My error.

Leon Stepanian
Perl.................from an ocean of human kinds.



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

Date: Mon, 22 Jun 1998 20:21:58 -0400
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: Sending files via mail in perl
Message-Id: <schinder-2206982021580001@schinder.clark.net>

In article <6mloks$v6$2@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, 
}      Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels) writes:
}  :I find it easiest to use Net:SMTP to send mail. It has
}  :the advantage that it works on MS Windows 1 derived platforms
}  :as well as UNIX ones. 
}  
}  What about queueing?  What about temporary failures?  What
}  about MX records?  What about secondaries?  What about 7-to-8
}  bit conversions or vice versa?  

Use Net::SMTP to relay through either a server on the local machine, or a
"nearby" server that is reliable, like the SMTP server of your ISP if your
ISP is good.  Then you'd take care of these problems while still being
able to use platform portable Perl.

}  
}  If that seems like a good idea to you, perhaps you should
}  just telnet to the SMTP port.  
}  
}  In short, this is *not* a good idea.

Not for bulletproof code, but there are ways around without running sendmail.

}  
}  --tom

-- 
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@leprss.gsfc.nasa.gov


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

Date: 23 Jun 1998 01:20:27 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Sending files via mail in perl
Message-Id: <898565340.370110@thrush.omix.com>

Paul J. Schinder <schinder@leprss.gsfc.nasa.gov> wrote:
: Use Net::SMTP to relay through either a server on the local machine, or a
: "nearby" server that is reliable,

	SMTP is by definition unreliable, which is why MTAs even exist.

: like the SMTP server of your ISP if your
: ISP is good.  Then you'd take care of these problems while still being
: able to use platform portable Perl.

	Reduce a very little, but not "take care of" by any extent.  And
	contrary to what some misbelieve, using SMTP directly makes your
	code even *less* portable as it's then tied directly to your local
	system/network configuration. -Not all MTA even use SMTP or TCP/IP
	at all, BTW.  It's also *not* your job to care about that.

	>snip<
: Not for bulletproof code, but there are ways around without running sendmail.

	Yes, there are ways to work around systems lacking an MTA.  If you
	must work in suck conditions and want to stay at all portable at
	least use a best method test:

	if (-e sendmail) {
	    send_mail_reliablely();
	}
	else {
	    wish_me_luck();
	}

	Is this so hard to do?  I'm not saying never to use SMTP directly,
	but don't ever fool yourself into claiming it's even close to as
	reliable or portable as sendmail.  To not at least try to use
	sendmail (or some other local MTA) first is simply false laziness
	and it will burn you.
-- 
-Zenin
 zenin@archive.rhps.org


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

Date: 23 Jun 1998 00:50:10 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: sendmail problems
Message-Id: <898563523.153858@thrush.omix.com>

Neil Briscoe <neilb@zetnet.co.uk> wrote:
: Who needs to write a spooling routine?  You get it to talk to your local
: mail server.  If it can't send the mail to the target, for whatever
: reason, it will spool the mail for the length of time its administrator
: has set it for.

	Iff you can get to your local mail server.  Via SMTP this requires a
	running SMTP daemon somewhere (the localhost may (likely) not be running
	an incoming MTA at all, nore does it need to), the network has to be up
	between you and it, and many, many other problems which have been
	thrown around here far too many times (see DejaNews if you really care).

	What it comes down to is that chances are the local MTA will know
	how to deliver the mail, and if any changes are made to the network
	the admin is very unlikely to know or bother to reconfigure
	anything but the MTA.  -It is *extremely* unlikely they will even
	think to look at each and every program on a machine to make sure
	however it's trying to do to send mail will still work (ie, it's
	not going to happen).  If anything funky happens (SMTP server,
	network, whatever) is acting up, sendmail can spool the mail for
	you correctly.	When talking SMTP directly, this won't happen (BTW,
	and SMTP server can be running and refuse to accept mail because
	its own spool is full, in which case it will *expect you* to que
	the mail and resend at some future point in time).

	Mail, like pretty much everything else, is built as a protocal
	stack.  SMTP is at the MTA level.  You program is at the
	"application" layer.  Your application (unless you happen to BE
	an MTA) should *never* be trying to send mail on its own. 
	Delivery is the job of the MTA, not you.  In 20 years you couldn't
	code your application well enough to handle every condition
	correctly that may come up, nore should you ever have to.  This is
	what the MTA is for.  Why do you think sendmail is even there???

	Plain and simple, you're programming at the wrong level of the
	protocol stack and so you're asking, nay begging, to get burned
	for it.
-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Tue, 23 Jun 1998 01:42:49 GMT
From: jaws@atl.mindspring.com (John Armsby)
Subject: Re: Spider programms in PERL
Message-Id: <6mn1bh$i8n$1@camel18.mindspring.com>

Funny, I was surfing this newsgroup because I had the same question.
I run linux 2029, have perl 5.004 with libwww for perl5 installed.  I
downloaded MOMspider-1.00.  I religously downloaded all the .pm
modules the MOMspider literature said I needed.  After about 4 hours
of error messages, I realized that it was probably looking for libwww
for perl4 and that libwww perl5 was NOT going to work!

Now I am in this thread and I read smart alecky remarks telling a
newbie to go to the LWP and other such modules and "figure it out".

The guy who started this thread is probably not stupid and neither am
I.  If you guys know so much, either return a civil answer to someone
who has more to learn and attempted to do so by posting to this
newgroup, OR skip to another posting.  

Meanwhile, I am going to try to figure out how to take a bunch of IP
addresses, and see if Perl can tell me if there is a web daemon
running, and give me a simple list of URLs  on that box.  

John Armsby
"Leonid A.Arcadiev" <arcadiev@usa.net> wrote:

>	Can anybody advice how to write a spider in perl, that would check on a
>website and read through its contents.  If the responce has been received,
>everything is fine, if no responce, generate an error message.
>	Please post a reply or send it to arcadiev@usa.net

>Many thanks in advance,

>Sincerely,

>L.A.Arcadiev





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

Date: Tue, 23 Jun 1998 00:51:48 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Warnings from environment variables under -w
Message-Id: <Pine.GSO.3.96.980622165157.3398L-100000@user2.teleport.com>

On Tue, 23 Jun 1998, Stephan Carydakis wrote:

> I am getting warnings(uninitialised value)  from references to
> environment variables. I wish to rid myself of these warnings :].

Check that each variable is defined() before using it in an expression. 

> I have tried including both %ENV and individual environment
> variables in the 'use vars qw' list but this doesn't work.

'use vars' will not change the _value_ of a variable - if it was
uninitialized, it's still uninitialized. (But you never need to use 'use
vars' on Perl's special global vars like %ENV or $_, anyway. And it's not
useful to specify an element of an array or hash.)

> Is it really necessary to get rid of these warnings?

Depends upon your program logic. Perl is, in effect, saying, "You're using
this variable as if you expected to find it full of data. Well, it ain't!"
Whether that means something is wrong in your program logic depends upon
your program logic. 

As a rule, you shouldn't ignore any of perl's warnings until you're sure
that you know better than it does about whatever you're doing. But for
nearly any spurious warning, you can write somewhat more standard code
which avoids it. 

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 22 Jun 1998 17:24:15 -0700
From: James Hague <jhague@dadgum.com>
Subject: Writing Perl extensions in languages other than C/C++
Message-Id: <Pine.LNX.3.95.980622172041.7736A-100000@animal.blarg.net>

I'd like to create some Perl extensions that aren't written in C. 
Consider it an exercise in bone-headedness and nothing more :-)  So here's
my question:  has anyone written-up an explanation of linkage between Perl
and external routines on a lower level than xstut?  (I have to admit I'm
not too keen on xs; it creates more complexity than it hides. IMO.)  This
is a Win32 specific endeavor. 

Here's a perfect opportunity for users of Perl and Forth/assembly/
Delphi/Scheme/whatever to come out of the woodwork... 

--
James Hague
Dadgum Games
http://www.dadgum.com/



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

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

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