[12996] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 406 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 6 15:07:26 1999

Date: Fri, 6 Aug 1999 12:05:12 -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           Fri, 6 Aug 1999     Volume: 9 Number: 406

Today's topics:
    Re: a time to kill <tchrist@mox.perl.com>
    Re: a time to kill (Larry Rosler)
    Re: chomp not working (Larry Rosler)
    Re: Complex data structure (Larry Rosler)
    Re: Congressional Actions threatens programmer pay rate <kims@emmerce.com.au>
        DBI ODBC memory leak?? mcm1303@my-deja.com
    Re: DOS "EOF" (CTRL-Z??) (Stuart Slaugh)
        Free CGi Server for a web-form ? not webspace saulob@elogica.com.br
        GDMB file tied to hash variable <lillyste@pilot.msu.edu>
    Re: Getting return value from .exe called from system <cassell@mail.cor.epa.gov>
    Re: How [not] to be Y2K compliant <flavell@mail.cern.ch>
    Re: How [not] to be Y2K compliant <tchrist@mox.perl.com>
    Re: How [not] to be Y2K compliant <cassell@mail.cor.epa.gov>
    Re: I guess this is a Misc question: Cgi-bin <cassell@mail.cor.epa.gov>
    Re: I guess this is a Misc question: Cgi-bin (Bart Lateur)
    Re: Nastiness contrary to the spirit of perl? (Darrell Stec)
    Re: Nastiness contrary to the spirit of perl? <sariq@texas.net>
    Re: New to Perl - Question About RegExpr (Dan Wilga)
    Re: New to Perl - Question About RegExpr <cassell@mail.cor.epa.gov>
    Re: Newbie question about $_ <sariq@texas.net>
    Re: newbie question: splitting hairs <cassell@mail.cor.epa.gov>
        non-parsed <ch.hehn@bluewin.de>
    Re: non-parsed <kims@emmerce.com.au>
    Re: Perl is Not Opening a file (Bart Lateur)
    Re: POST via Imagemap - How? { Use a redirecting script <makarand_kulkarni@my-deja.com>
    Re: POST via Imagemap - How? { Use a redirecting script <makarand_kulkarni@my-deja.com>
    Re: Reading a file into array PERL NEWBIE <cassell@mail.cor.epa.gov>
    Re: send perl-users FAQ (Marcel Grunauer)
    Re: SSH2, Need a little help <xeno@bigger.aa.net>
    Re: SSH2, Need a little help <sariq@texas.net>
    Re: storing data that is read in in an external file <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 6 Aug 1999 12:22:35 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: a time to kill
Message-Id: <37ab27eb@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    jeromeo@atrieva.com (Jerome O'Neil) writes:
:Just out of curiosity, on average, what percent of posts to c.l.p.m get
:killed by your killfile?  I think it is a good indicator of the upper
:bound on the newsgroup's DB level.

I think it's about 40% or so.  Sometimes more.  It depends on
whether I turn on the "news browser" checks, which I usually leave
disabled unless I'm reading on a fast connection over nntp rather
than my normal 33ish modem.

--tom
-- 
Like Dennis' love note about rk05s, early Berkeley tapes cane with a
suggestion from Bill Joy that "this is a tape of bits," meaning there was no
guarantee of anything, and that complaints should be directed to /dev/null.
 --Andy Tannenbaum, "Politics of Unix," Washington, DC USENIX Conference, 1984


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

Date: Fri, 6 Aug 1999 11:46:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: a time to kill
Message-Id: <MPG.1214cd5e6d4f221c989df0@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <37ab0227@cs.colorado.edu> on 6 Aug 1999 09:41:27 -0700, Tom 
Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, fl_aggie@thepentagon.com (I R A Darth Aggie) writes:
> :Fine. You know who we are. Get a killfile, stick us in it, and be done
> :with it. And provide that killfile to the newbies, so they can ignore
> :us, too.
> 
> Two can play at that game.  I see that it's time to put together and
> post a comprehensive killfile again.

One of the more literary posts in a long while.

1.  Subject: Ecclesiastes

 ...

> Now the article selectors.  Not all are current, for long ago they passed
> away to Mordor where the shadows lay.

2.  Tolkien

 ...

>     /rosler/f:+

I'm flattered.  But I know at least one of my friends won't be, by his 
omission.  :-(

 ...

> Now kill any "spamblocked" addresses.  If they want to be read, they can
> bloody well use their own address.  I don't believe in address munging.
> Let them munge themselves into oblivion.  This is not an acceptable
> way to fight spam.

    /\bspam/h:j

I don't like that '\b'.  What about 'nospam'?

> Blessèd is he who heeds these advisories:

3.  Matthew

 ...
 
> Here are posters who've proven just too nasty for cohabitation.
> Some are killed worse than others; that is, we kill their children's
> children's children as well, yea even unto the Nth generation of
> them that piss sulfuric vitriol in your mouth and eyes and serenity:

4.  Exodus, Deuteronomy

 ...

> First we kill anybody so clueless as not to include lower-case letters
> in their subject.  STOP SHOUTING, YOU NIMRODS!

5.  Genesis
 
>     /^Subject:[Re: ]*[^a-z]*$/c:j
> 
> Perl 4 is dead.  Dead dead dead dead.  Dust it was and dust 'twill be
> next time a post on it I'll see.

6.  Genesis
 
 ...

> Out, out, you demons of stupidity!

7.  Mark, Luke, Acts

 ...

> Quell the querulous querents who can't read a FAQ:

Just a little harmless alliteration here.  Oh, well...

 ...

> Look upon me ye mighty, and despair:

8.  Shelley (Ozymandias)

 ...

> Pax vobiscum.

9.  Tridentine Mass, et al.

Et cum spirito tuo.

What did I miss, anyone?

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 6 Aug 1999 11:08:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: chomp not working
Message-Id: <MPG.1214c469224f95ed989dee@nntp.hpl.hp.com>

In article <x3y672tc8td.fsf@tigre.matrox.com> on Fri, 6 Aug 1999 
09:55:42 -0400 , Ala Qumsieh <aqumsieh@matrox.com> says...
> jembow@my-deja.com writes:
> 
> > #!/usr/bin/perl -w
> > $x = "good night\n";
> > chomp($x);
> > print($x);
> > 
> > yields the following error message. "Chop", however, works fine:
> > 
> > "chomp" may clash with future reserved word at ./chomp_test line 
> > 3syntax error i
> > n file ./chomp_test at line 3, next 2 tokens "chomp("
> > Execution of ./chomp_test aborted due to compilation errors.
> 
> This should work fine. Type the following at the command prompt:
> 
> 	perl -v
> 
> and report the results. You seem to have an older Perl.

Not quite right.  At the command prompt, type:

      /usr/bin/perl -v

because that is the perl the program is using, which need not be the 
first one in the user's path.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 6 Aug 1999 11:10:28 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Complex data structure
Message-Id: <MPG.1214c4ea99584aa9989def@nntp.hpl.hp.com>

In article <7oet75$nlt$6@info2.uah.edu> on 6 Aug 1999 14:58:45 GMT, Greg 
Bacon <gbacon@itsc.uah.edu> says...
> In article <MPG.1214942a62975623989de8@nntp.hpl.hp.com>,
> 	lr@hpl.hp.com (Larry Rosler) writes:
> :              print "Code = $_\n" for @{$Codes{$Comp}};
> : 
> : is shorter and cleaner and won't get you talked about.  :-)
> 
> [whispered] Hey, everybody, come look at the CAPITAL LETTERS that this
> Larry Rosler guy uses in his variable names. :-)

The whispering campaign actually started about my liberal use of 'fat 
commas' =>.  :-)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 6 Aug 1999 04:13:50 +1000
From: "Kim Saunders" <kims@emmerce.com.au>
Subject: Re: Congressional Actions threatens programmer pay rates encore
Message-Id: <933963213.839932@draal.apex.net.au>

>Calm down, Kim.  Just take a deep breath and remember.  This bozo
>doesn't
>*have* any `European friends'.  I doubt he has any friends whatsoever,
>if
>he has to post c@#p like this on usenet.
>
>As an American who isn't insane, let me apologize for this schmuck.
>Now just call him a Nazi, and we'll end the thread.  :-)


Indeed. I just felt the need to explain to him that, althoug I'm sure it's a
nice place, etc, and there are lots of nice good ppl like yourself there,
it's not as brilliant as it superficially thinks it is. That was all, many
yanks are rather obsessed with their brilliant country, democracy, freedoms,
etc, when in reality they take this to extremes to deny it to many. Let's
all carry guns to make the place safer! Yup... Now that he has a dose of
reality, perhaps he can see the world for what it is. Nobody's perfect, not
even the USA..

KimS



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

Date: Fri, 06 Aug 1999 18:29:04 GMT
From: mcm1303@my-deja.com
Subject: DBI ODBC memory leak??
Message-Id: <7of9h2$j9v$1@nnrp1.deja.com>

I'm converting a large database from one system to another.  I wrote
several perl scripts to handle the conversion.

Environment: Win32 (Winnt), DBI::ODBC
Database: MSSQL 6.5

All I'm doing is executing several thousand $dbh->prepare +
$dbh->execute statements to perform SQL selects.  The MSSQL temporary
database on the server just grows and grows until it runs out of disk
space...

Also experimented using the $sth->finish, thinking that might help, but
the problem persists.

Any ideas? Many Thanks -- Marlin Mixon


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


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

Date: Fri, 06 Aug 1999 19:03:53 GMT
From: ohyeahh@worldnet.att.net (Stuart Slaugh)
Subject: Re: DOS "EOF" (CTRL-Z??)
Message-Id: <37ab311e.10684550@netnews.worldnet.att.net>

On Fri, 6 Aug 1999 00:35:14 -0400, "Ken Hirsch" <kenhirsch@myself.com>
wrote:

>Stuart Slaugh <ohyeahh@worldnet.att.net> wrote:
>[cc'd]
>> I am a new perl programmer.Whenever I attempt to read a list of
>> strings from STDIN into an array, I am unable to indicate EOF in the
>> usual manner; e.g., pressing CTRL-Z. Each time I do this, the program
>> terminates and I am returned to the command prompt. I am using
>> ActiveState under Win98. Here is the code: ( this is from an exer-
>> cise from the "Camel" book)
>>
>> print "Enter a number: ";
>> chomp($num = <STDIN>);
>> print "Enter some strings: ";
>> @a = <STDIN>;
>> print "The word is: $a[$num - 1];
>>
>
>I'm not sure exactly what is happening, but if you
>    print "\n";
>before
>    print "The word is: $a[$num - 1]";
>
>then you'll see the output.
>
>Anybody know what's going on?
>
>By the way, the code you posted is missing a quote ".  You should carefully
>cut and paste your actual code.
>
>
>
>
Thank you very much, your solution solved my problem.
It was that pesky newline character that made the difference.
			Stuart Slaugh


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

Date: Fri, 06 Aug 1999 18:10:07 GMT
From: saulob@elogica.com.br
Subject: Free CGi Server for a web-form ? not webspace
Message-Id: <7of8dl$idu$1@nnrp1.deja.com>

anyone know a page that have free cgi server ?
i need to do a webform.. don't need space..
thank you.


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


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

Date: Fri, 06 Aug 1999 14:10:36 -0400
From: "Steven R. Lilly" <lillyste@pilot.msu.edu>
Subject: GDMB file tied to hash variable
Message-Id: <37AB251C.D685EAC@pilot.msu.edu>

I would like to tie a GDBM file to a hash variable. Any ideas on how to
do this?

I was able to do this by using "tie" with the GDBM_File module on my
Linux system which has a newer version of perl. It would seem that this
module is built-in to this version of perl (Please correct me if I am
wrong).

The problem is that I need to do this on a box (Solaris) which is
running version 5.004_04 of perl. I can't seem to find the GDBM_File
module anywhere on CPAN. I tried using the AnyDBM_File module and "tie",
with no success. Here is a test script:

#!/opt/bin/perl -w

use 5.004;
use strict;
use AnyDBM_File;

my $dbfile = "data.gdbm";

my %DBFILE;
tie(%DBFILE, "GDBM_File", $dbfile, 1, 0);
untie(%DBFILE);

And here is the error message:

Can't locate object method "TIEHASH" via package "GDBM_File" at
 ./tie_test.pl line 10.

I have also tried using the (outdated) dbmopen function. Supposedly,
this can be used to access GDBM files. I couldn't get this to work,
either though. Is there a way to specify to dbmopen that the file I wish
to create/read is a GDBM file?

Thanks in advance for any help.

-Steve

-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Steven R. Lilly                    FFCC/HISS                 |
| Programmer                         Computer Laboratory       |
| lillyste@pilot.msu.edu             Michigan State University |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Fri, 06 Aug 1999 11:39:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Getting return value from .exe called from system
Message-Id: <37AB2BDD.4E9941C6@mail.cor.epa.gov>

Oh by the way, deja.com seems to be doing something totally weird with
your line wrap.  Just in case you hadn't noticed...

rick_bindview@my-deja.com wrote:
> 
> In my perl script I want to call an exe using
> 'system' that exe returns a number. However the
> number I am getting back is 128. Not the number I
> am looking for from the exe return.
> 
> Can anyone help?

Yes.  You're probably misusing system().  The return value of system
is the exit status of your program as returned by the wait(2) call..
or whatever the closest equivalent is on NT.  So you're looking at
the error information, not the product of your program.

Read the perlfunc docs on system() and qx// to learn that there
is a big difference, and that you probably want to be using qx//
instead.  Although you could use a pipe open to do this too.

HTH,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Fri, 6 Aug 1999 19:18:41 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How [not] to be Y2K compliant
Message-Id: <Pine.HPP.3.95a.990806191446.17374Q-100000@hpplus03.cern.ch>

On 6 Aug 1999, Tom Christiansen wrote:

>     "Alan J. Flavell" <flavell@mail.cern.ch> writes:
> :Wibble.
[...]
> How were you using it?

May I refer the Hon. Usenaut to this for example:

http://www.newnet.org.uk/develop/glossary.htm

Seems to have become popular recently hereabouts.  altavista finds
numerous references, many of them UK-centric.  One page asserted that
in New Zealand the term "wibble" is used as a meta-variable, analogous
to the US usage "foo".

-- 

  "I have no problem with cute and clever.  In fact I actually _like_ cute
  and clever.  I don't think it's clever to be cute in such a way as to
  make the pages less useful.        But then I'm not a graphic designer."
                        -     Calum I Mac Leod on c.i.w.a.site-design




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

Date: 6 Aug 1999 12:12:06 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How [not] to be Y2K compliant
Message-Id: <37ab2576@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Kim Saunders" <kims@emmerce.com.au> writes:
:Gee Tom, didn't realise you had so much spare time? I'd have though you were
:to busy for this???

Summer is a holiday.

--tom
-- 
    "Just because something is obviously happening doesn't mean something obvious
    is happening." --Larry Wall


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

Date: Fri, 06 Aug 1999 11:40:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How [not] to be Y2K compliant
Message-Id: <37AB2C3A.82FEB717@mail.cor.epa.gov>

Alan J. Flavell wrote:
> 
> For those with strong nerves, this posting to the WWW CGI group
> 
> <37aa61fe@news5.newsfeeds.com>
> 
> seems to be an "object" lesson (sorry) in how not to use Perl.
> 
> Here's a taster:
> 
>   if ($year == 99) {$fullyear = "1999";}
>   else {$fullyear = "20$year";}
> 
> Wibble.

An appropriate quote for this:

"You made me wet my armor!"  - Sir Robin the Not-So-Brave

David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Fri, 06 Aug 1999 11:11:12 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37AB2540.F06AFC53@mail.cor.epa.gov>

Alan J. Flavell wrote:
> 
> On Thu, 5 Aug 1999, Ben Quick (AGGTA B.O.D) wrote:
> 
> > Could anyone remind me of what my cgi-bin should be chmoded to.
> 
> Remind?  _Remind_?  You claiming to have previously known this, yet now
> you can neither work it out for yourself nor discover which usenet group
> to post to?

Uh-oh, look at his name.  Don't get him mad, or he might burn your
barn down one night.  :-)

David, posting from Yoknapatawpa County
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Fri, 06 Aug 1999 18:46:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <37ac2d42.6502241@news.skynet.be>

Ben Quick (AGGTA B.O.D) wrote:

>Could anyone remind me of what my cgi-bin should be chmoded to. I have had
>to create my own, therefore I have to chmod it. 755 seems to be the norm,
>but is it different for the bin?

I'd say: R and X for everybody, plus W for owner, if you still want to
be able to upgrade your scripts.

	Bart.


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

Date: 06 Aug 1999 18:18:58 GMT
From: darstec@aol.com (Darrell Stec)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <19990806141858.22915.00003391@ngol05.aol.com>

In article <MPG.1214ce2074ecc0d6989beb@news-server>, elephant@squirrelgroup.com
(elephant) writes:

>
>why@invite.flames writes ..
>>Actually, I have found this group to be the most intolerant in all of
>>the "professional computing" (comp.data.*,comp.lang.*,sybase.*,etc.)
>>groups I monitor. EVERY group has questions from people who do not
>>invest time in reading README.1ST, it is the nature of a "bulletin
>>board" - a lot of junk, and some useful gems.
>
>IMHO there are several reasons why so many novice posts receive RTFM 
>responses so brutally in this newsgroup
>
>1) perl is inextricably tied to CGI programming for reasons beyond my 
>understanding .. and that means that the perl newsgroups get their fair 
>share of the "I own FrontPage so I can create web pages and build a 
>business on it." riff-raff that pervades the web design industry
>
>these people are often completely ignorant of internet standards 
>(including usenet posting standards) .. and almost always don't want to 
>learn more than the bare minimum to get by

I don't think there were ever "real" standards on the Internet.  The Internet
is the story of those who had one thing in mind when they started it, tried to
maintain that view, and watched it change by the participants who wanted to use
it for their own purposes.  Email was an example of that.  Beyond the
designer's imagination, the users started to send personal messages as well as
the intended research information.

Why are webpage designers riff-raff in your opinion?  You're beginning to sound
like the hoi poloi priesthood of IBM of the past from whom the sanctity of the
mainframe was wrenched.  Which ended up with the personal computer revolution
or invention.

>
>2) perl (far more than any language I know) has an enormous resource of 
>free documentation/tutorials/articles ALREADY WRITTEN .. and written 
>often times by the very same people who give the RTFM answers in here
>

Yes, there is a tremendous amount of free documentation written.  But shear
volume does not make it good, nor easy to navigate.  The documentation is as
easy to find something in as finding a particular sentence in a novel with
titles such as chapter one, chapter two, chapter three, etc., {perlfaq1,
perfaq2, perfaq3 or the equally descriptive perlapio, perldsc}.

Then perhaps these "very same people" who give the RTFM give this response
because they WTFM and just like to see their name in print.

 
>you need to ask yourself - why would someone spend many hours writing a 
>FAQ document or a manual page or a web tutorial/article/etc. and NOT 
>direct a question to that documentation when they see it asked ? .. why 
>would that author take the time to re-answer the question (possibly 
>making a typo or other mistake) instead of just directing the asker to 
>the pre-tested pre-prepared answer ???
>

I agree with you there.  It would be exasperating for the authors to answer the
same questions that are in their books, over and over again.  After all those
that wrote the books, did so for the money, not because they love teaching
which involves explaining the answer over and over again in many parallel ways
until the student understands it.  But those very same authors DON'T HAVE TO
ANSWER.  For every one of them, I would venture that there are 1000 lurkers who
would be happy to answer the questions.  We are already seeing new "faces" in
this thread.  The only explanation that I can see as to why these authors keep
coming back to clpm instead of residing on the moderated group is that they
have to see their name in print.


>then ask yourself .. if you answer the same question three times in a day 
>.. even though your answers were just steering the asker to the 
>documentation .. don't you think you'd get a little annoyed .. not ONLY 
>do these people ignore all the free documentation on their own machines 
>.. but they ignore the questions and answers in the newsgroup
>

Then don't steer them to the documentation.   If they have it and still need to
ask a question, then obviously that documentation is too cumbersome, or doesn't
explain the answer in a way the questioner understands.  If every author were
able to get each and every point across with total clarity, we would only need
one book on every subject.  Think of the money that would save us, at home, for
libraries, at school!  And don't answer the question three times a day.  Let
someone else answer it for you.  How do you know that they are ignoring the
documentation instead of just not understanding it.  But yes, it is
exasperating seeing people post questions to newsgroups that have just been
asked that very same day or week.  It would be great if there were some
mechanism that could tell if someone had been subscribed to a newsgroup for a
month before passing a post through, but that doesn't exist.  Besides this
phenomena is not relegated to just the newsgroups.  It is a world wide problem
with VCRs, toasters, hair shears, cellular phones, etc.  The first thing the
owners of these products do, before they read the manual is to call the
manufacturerer's toll free number, or the store where they purchased it from. 
You should try dealing with people that buy cash registers, if you think this
newsgroup is bad.


>3) perl is too easy .. just about anyone - with a little example - could 
>hack about and make it do what they want .. this encourages novices to 
>get cracking - instead of actually learning
>

Perl like the C language it came from is NOT as easy as you are trying to
portray.  Of all that languages I have used and that includes assembly for
various microprocessors, IMO they are two of the more inane because of their
cryptic, terse style.
 
>to stomp this out (as quickly as possible) the answer to questions in 
>here is intentionally harsh .. basically because it's tough love .. the 
>novice would do far better getting into the documentation and reading 
>about the language .. they'll learn more and will be able to write better 
>code
>
>if the answer was just given to them .. then tomorrow they'll have 
>another question .. and the next day .. and even when all the answers 
>have been given to them - their code will still be buggy and crap
>
>it's so easy to write shite in perl .. but it'll work .. sometimes - or 
>even most of the time .. and without understanding the documentation - 
>there's no hope of getting it right

If it is so easy to write "shite" in perl and it'll work  -- then they got it
right, but maybe not just elegant or quick.

>
>>Those who seem to get overly upset over questions answered with RTFM,
>>to me are like those who want to censor everything in modern media.
>>Instead of ignoring what they do not want to see, they feel empowered
>>to tell everyone else what that can post. For me, "if you do not want
>>to see it, change the channel" works just fine.
>
>so who's side are you on .. you say that this group is intolerant .. but 
>at the same time those who find it intolerant should just switch off ?
>
>-- 
> jason - elephant@squirrelgroup.com -
>
>

It is obvious that he is not on the side of those that say RTFM.  He just wrote
several paragraphs explaining why.  You just bulldozed over his remarks by
reiterating your opinion that 'the authors, and we regulars just have to tell
them to RTFM'.  No you don't.  As he suggested, ignore those posts and cut down
on the noise ratio.  Some else will answer those questions in your stead.  If
one doesn't like the noise, please explain why they simply don't switch the
channel and stay on the moderated group where everything is quiet?

Later,
Darrell Stec                               E-Mail: DarStec@aol.com

Webpage Sorcery
http://webpagesorcery.com
We Put the Magic in Your Webpages




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

Date: Fri, 06 Aug 1999 13:51:01 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <37AB2E95.D835A827@texas.net>

Darrell Stec wrote:
> 
> I don't think there were ever "real" standards on the Internet.  

This statement displays such incredible ignorance that few will bother
to read further.

- Tom


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

Date: Fri, 06 Aug 1999 14:17:38 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: New to Perl - Question About RegExpr
Message-Id: <dwilgaREMOVE-0608991417380001@wilga.mtholyoke.edu>

In article <dLCq3.51125$jl.34214219@newscontent-01.sprint.ca>, "Derek
Battams" <dbattams@canada.com> wrote:
> (1) Exactly what does the "=~" operator do?  I've been reading the limited
> information that I have found on the Internet, but this has not come up.

It binds a regular expression search/replace/translation to a particular
variable.

> (2) Are there any other similar operators like "=~"?  If so, what do they
> do?

"Similar" is in the eye of the beholder, methinks. You should look at the
documentation page called "perlop" for the answer to this question. If you
are using a Unix machine, one way would be to enter the command:  perldoc
perlop

> (3) Where is the best place to learn about regular expressions (how to write
> them, etc.)?

The doc page "perlre" is a very good starting place.

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


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

Date: Fri, 06 Aug 1999 11:31:21 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: New to Perl - Question About RegExpr
Message-Id: <37AB29F9.36084384@mail.cor.epa.gov>

Derek Battams wrote:
> 
> I've just started to write CGIs in Perl (I've been writing them in C) and
> I've come across the following line in a script that someone else has
> written:
> 
> $Config{'required'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g;

The question you forgot to ask is: "Is this regex any good?"
I doubt it.  The author didn't seem to know that the character class
\s includes the newline \n already, so this regex seems to do a lot
more work than is needed.
 
> I realize that this is a regular expression, but here are my questions...
> 
> (1) Exactly what does the "=~" operator do?  I've been reading the limited
> information that I have found on the Internet, but this has not come up.

It's the pattern binding operator.  See the perlop doc for more info,
but basically it tells Perl to do the s/// on the scalar expression on
the left.

> (2) Are there any other similar operators like "=~"?  If so, what do they
> do?

There's lots of documentation in the perlop and perlre sections,
which should be on your hard drive.  But check out !~ which returns
the logical negation of =~ .

> (3) Where is the best place to learn about regular expressions (how to write
> them, etc.)?

Well, the perlre doc tells all about the regex features, and the perlop
doc tells about the ways to use regexen [among other things].  But you
might want to start with something like the regex section of this web
tutorial:
http://www.netcat.co.uk/rob/perl/win32perltut.html
which is not win32-centric despite the title.
 
> Sorry for the silly newbie questions, but your help would be greatly
> appreciated.
> 
> Thanks,

You're welcome,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Fri, 06 Aug 1999 13:04:24 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Newbie question about $_
Message-Id: <37AB23A8.6A65DD13@texas.net>

steveeq1@earthlink.net wrote:
> 
> Ok,
> 
> here is a newbie question about $_.

I follow you so far...

> If $_ is at a certain point. Is
> there a way to move it to the PREVIOUS line instead of the next line?

Hmmm...

man vi

Seriously, do you mean:

"I'm looping through a file line-by-line.  How do I get back to the
previous line?"

- Tom


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

Date: Fri, 06 Aug 1999 11:09:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: newbie question: splitting hairs
Message-Id: <37AB24F0.34C96B7D@mail.cor.epa.gov>

Boris Klimovitsky wrote:
[snip]+
> I'd been (obviously mistakenly) laboring under the assumption that you could
> use perl similarly to awk in this respect: awk '{print $2,$3}' file
> and thought it would be simpler to extract columns as I had been trying
> to do.
[big snip]

Actually, you can do this.  Take a look at the perlrun doc to see the
command-line options available.  To get the rough equivalent of the
above awk command, try this:

perl -wlane 'print @F[1], @F[2]' file

You were looking at $2 and $3 and thinking in terms of a direct
transfer`
instead of a transliteration, weren't you?

HTH,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Fri, 6 Aug 1999 20:12:02 +0200
From: "Christian Hehn" <ch.hehn@bluewin.de>
Subject: non-parsed
Message-Id: <7of8a0$bec$1@stu1id2.tesion.de>

I'm looking for a free Windows 9x webserver which supports "non-parsed
headers" (for offline-developing).
Answers please to ch.hehn@bluewin.de,
Thank you
Christian Hehn




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

Date: Fri, 6 Aug 1999 04:20:33 +1000
From: "Kim Saunders" <kims@emmerce.com.au>
Subject: Re: non-parsed
Message-Id: <933963617.290271@draal.apex.net.au>

>I'm looking for a free Windows 9x webserver which supports "non-parsed
>headers" (for offline-developing).
>Answers please to ch.hehn@bluewin.de,


Well you had better go ask someone who knows or cares about webservers then,
if not find out for yourself. This has WHAT to do with perl???

KimS



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

Date: Fri, 06 Aug 1999 18:42:31 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl is Not Opening a file
Message-Id: <37ab2c4d.6257550@news.skynet.be>

craig_davids@my-deja.com wrote:

>I've been using Perl on an NT 4.0 server as a development platform and
>then I port my scripts to a unix server for production.  Everything has
>been working fine.  However, I copied some scripts from UNIX to my NT
>server and found a problem with them when executed via the browser.
>
>can't open datafile: No such file or directory at
>C:\Inetpub\wwwroot\~Kaf\secure\com_fin\data\read.cgi line 4.
>
>When executed at the command line (using telnet) they work fine. 

It could be the current directory. Try

	use Cwd;
	print cwd;

embedded in a CGI script. If the result surprises you, you've nailed the
bugger.

	Bart.


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

Date: Fri, 06 Aug 1999 18:12:30 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: POST via Imagemap - How? { Use a redirecting script}
Message-Id: <7of8i5$igl$1@nnrp1.deja.com>

[In article <37A99330.8E8DA1D6@nauiww.org>,
  Carl Meilahn <cmeilahn@nauiww.org> wrote:]
> I was wondering if you know a short-cut for submitting to a cgi
> script that uses the POST method (Solena Sol's db_manager) via an
> imagemap (client side) rather than using the post method in a
> form.  The post method uses "db_search_and_display_button" as
> submit's value, but I'm not sure how to include that in the
>
[Background information ...snip snip snip..]

I am assuming that you are in a situation where you are unable
to change your server side cgi scripts to handle GET or want
them to handle POST only. I think that this can be done by writing
a redirector script. All HREF's from all regions of your imagemap
will call this redirector.cgi script with two extra name/value
pairs.

submitbutton=db_search_and_display_button
region=xxx

The redirector.cgi will then use GET and then redirect this
to the appropriate original CGI using POST. It will filter
out region=xxx pair after using this redirecting purposes.
This redirector will not generate any HTML tags/headers etc.
It will retrive the page from the original CGI using a POST
request ( as a string ) and print this out.

There is an easy way of invoking POST requests to CGIs using
name/value pairs described beautifully on page 710 of 'Perl Coookbook'.
It uses  HTTP::Request::Common and LWP::UserAgent.
Your redirector script can funnel the params to the original
CGI using POST. If you are using a PROXY then there is an
extra step involved -- which is also described in the Cookbook.

Hope this helps.

--
Makarand



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


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

Date: Fri, 06 Aug 1999 18:13:14 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: POST via Imagemap - How? { Use a redirecting script}
Message-Id: <7of8jf$igu$1@nnrp1.deja.com>

[In article <37A99330.8E8DA1D6@nauiww.org>,
  Carl Meilahn <cmeilahn@nauiww.org> wrote:]
> I was wondering if you know a short-cut for submitting to a cgi
> script that uses the POST method (Solena Sol's db_manager) via an
> imagemap (client side) rather than using the post method in a
> form.  The post method uses "db_search_and_display_button" as
> submit's value, but I'm not sure how to include that in the
>
[Background information ...snip snip snip..]

I am assuming that you are in a situation where you are unable
to change your server side cgi scripts to handle GET or want
them to handle POST only. I think that this can be done by writing
a redirector script. All HREF's from all regions of your imagemap
will call this redirector.cgi script with two extra name/value
pairs.

submitbutton=db_search_and_display_button
region=xxx

The redirector.cgi will then use GET and then redirect this
to the appropriate original CGI using POST. It will filter
out region=xxx pair after using this redirecting purposes.
This redirector will not generate any HTML tags/headers etc.
It will retrive the page from the original CGI using a POST
request ( as a string ) and print this out.

There is an easy way of invoking POST requests to CGIs using
name/value pairs described beautifully on page 710 of 'Perl Coookbook'.
It uses  HTTP::Request::Common and LWP::UserAgent.
Your redirector script can funnel the params to the original
CGI using POST. If you are using a PROXY then there is an
extra step involved -- which is also described in the Cookbook.

Hope this helps.

--
Makarand



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


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

Date: Fri, 06 Aug 1999 11:22:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Reading a file into array PERL NEWBIE
Message-Id: <37AB27E4.5104246D@mail.cor.epa.gov>

Skyrockets wrote:
> 
> On Thu, 05 Aug 1999 10:05:05 -0800, eric@thejensens.com (Eric Jensen)
> wrote:
> 
> >I am having trouble reading a file of CSV email addresses into an array.
> >
> >I am opening the file...but unsure of how to read the file up to a comma
> >(',') and place the information prior to the comma into an array slot.
> >
> >Any suggestions accepted.
> >
> >Eric
> >eric@thejensens.com
> 
> I'm a newbie too. basically I think it would involve using the split
> function and a foreach loop. I can't recall all the specific details
> offhand, but this kind of thing is a very basic part of perl/cgi
> programming.

Yes, but it is usually done quite badly, or quite messily.  If you
split() on ',' then all quotes with commas inside get ripped asunder.
That's usually a big oops.

The easy way is via modules, since this has been done before.
The Text::CSV_XS provides a variety of routines for manipulating
comma-separated values.  There is also a DBD::CSV module for 
treating CSV files as databases, although I won't guarantee that
DBD::CSV will work properly on win95 [it should on NT].

HTH,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Fri, 06 Aug 1999 18:24:41 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: send perl-users FAQ
Message-Id: <37ad2593.1446029@enews.newsguy.com>

On Tue, 03 Aug 1999 14:26:04 -0400, bill@fccj.org ("Bill Jones")
wrote:

>send perl-users FAQ

Good idea.


Marcel



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

Date: Fri, 06 Aug 1999 18:10:25 GMT
From: Xeno Campanoli <xeno@bigger.aa.net>
Subject: Re: SSH2, Need a little help
Message-Id: <933962965.328498@cacheraq001>

Tom Briles <sariq@texas.net> wrote:

: Xeno Campanoli wrote:
:> 
:> How do I do:
:> 
:> @x = qw( C D . _ # M X N M V ALL )
:>
:  
: qq

: - Tom

Nope.  That doesn't work.  I want an answer that lets the following loop

for $x (@x)
{
print "x:  $x\n";
}

to print:

x:  C
x:  D
x:  .
x:  _
x:  #
x:  M
x:  X
x:  M
x:  V
x:  ALL

You answer gets me just:

x:  C D . _ # M X N M V ALL

I need to get what qw does with words but without the error for the sharp
character that it yields.  Sorry, by the way, for the impertinent title.
I'll repost under a good title.
-- 
Xeno Campanoli
Email:	xeno@aa.net	(Web pages:  http://www.aa.net/~xeno)


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

Date: Fri, 06 Aug 1999 13:41:03 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: SSH2, Need a little help
Message-Id: <37AB2C3F.2586DD90@texas.net>

Xeno Campanoli wrote:
> 
> Tom Briles <sariq@texas.net> wrote:
> 
> : Xeno Campanoli wrote:
> :>
> :> How do I do:
> :>
> :> @x = qw( C D . _ # M X N M V ALL )
> :>
> :
> : qq
> 
> : - Tom
> 
> Nope.  That doesn't work.  I want an answer that lets the following loop
> 
> for $x (@x)
> {
> print "x:  $x\n";
> }
> 
> to print:
> 
> x:  C
> x:  D
> x:  .
> x:  _
> x:  #
> x:  M
> x:  X
> x:  M
> x:  V
> x:  ALL
> 
> You answer gets me just:
> 
> x:  C D . _ # M X N M V ALL
> 
> I need to get what qw does with words but without the error for the sharp
> character that it yields.

Sorry...  My response was (offhand, and I realize now probably not
interpretable) shorthand for:

"Read the perlop docs - which say (emphasis mine):

-------

       qw/STRING/
               Returns a list of the words extracted out of
               STRING, using embedded whitespace as the word
               delimiters.  It is exactly equivalent to

                   split(' ', q/STRING/);

               Some frequently seen examples:

                   use POSIX qw( setlocale localeconv )
                   @EXPORT = qw( foo bar baz );

               A common mistake is to try to separate the words
               with comma or to put comments into a multi-line
               qw-string.  ***For this reason the -w
switch                       produces warnings if the STRING contains
the "," or                the "#" character.***
                                                 
-------"

You'll have to quote each element of the list, temporarily turn off
warnings, or live with the warning.

- Tom


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

Date: Fri, 06 Aug 1999 11:34:06 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: storing data that is read in in an external file
Message-Id: <37AB2A9E.B10F9C44@mail.cor.epa.gov>

chrisman81@my-deja.com wrote:
> 
> I want to open a file, read in all records from the file, and match
> cases, printing true returns to an external file.  Also, I have many
> records, each with many fields.  How can I make it so that new records
> are only recognized when there is a return character, or is that already
> default?
> 
> #!/usr/local/bin/perl -w
> open(FILE "/path/file");
> while(<FILE>) {
>         if(/match_this_expression/) {
>             what do i need here to print matched cases to an external
>           file?;
>         }
> }

Hmmm.  Isn't this the same question you asked last night?
I did give you an answer then.  Was there soemthing about it you didn't
understand?

Please don't post multiple questions for the same query.  It tends
to stir up the natives.  You could be flamed to a char-broil.  :-)

David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

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


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