[9432] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3025 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 30 14:18:24 1998

Date: Tue, 30 Jun 98 10:59:50 -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           Tue, 30 Jun 1998     Volume: 8 Number: 3025

Today's topics:
    Re: TIP: How to post good questions (Mark-Jason Dominus)
    Re: TIP: How to post good questions (Mark-Jason Dominus)
    Re: TIP: How to post good questions (Mark-Jason Dominus)
    Re: TIP: How to post good questions <jdf@pobox.com>
    Re: TIP: How to post good questions (Bob Trieger)
    Re: TIP: How to post good questions <scribble@pobox.com>
    Re: TIP: How to post good questions <ebohlman@netcom.com>
    Re: TIP: How to post good questions <quednauf@nortel.co.uk>
    Re: TIP: How to post good questions birgitt@my-dejanews.com
    Re: TIP: How to post good questions <quednauf@nortel.co.uk>
    Re: TIP: How to post good questions (I R A Aggie)
    Re: TIP: How to post good questions (I R A Aggie)
    Re: TIP: How to post good questions (Mark-Jason Dominus)
    Re: TIP: How to post good questions (Mark-Jason Dominus)
    Re: TIP: How to post good questions <mgregory@asc.sps.mot.com>
    Re: TIP: How to post good questions birgitt@my-dejanews.com
        Title Caps <rremington@westaff.com>
    Re: Title Caps (Larry Rosler)
    Re: Title Caps (Craig Berry)
    Re: trying to run a unix prog with perl <alf@orion.it>
        Two commands, one button. <darrensw@pacbell.net>
    Re: Two commands, one button. <rootbeer@teleport.com>
    Re: Two commands, one button. <quednauf@nortel.co.uk>
    Re: Two commands, one button. <jhi@alpha.hut.fi>
    Re: Two commands, one button. (Abigail)
        UNIX to NT changing cgi script <awakal@interactive.net>
    Re: UNIX to NT changing cgi script <bowlin@sirius.com>
    Re: Uploading perl scripts with a perl script. debel@bigfoot.com
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 28 Jun 1998 15:37:06 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: TIP: How to post good questions
Message-Id: <6n6612$7df$1@monet.op.net>
Keywords: ammonium given rood waste


In article <359217E8.5E2B004F@nortel.co.uk>,
F.Quednau <quednauf@nortel.co.uk> wrote:
>I agree. This article should appear more often. It makes a lot of sense.

It would be OK with me if someone wanted to do that.

I would like to fix the typoes and make a couple of minor wording
changes first, though.



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

Date: 28 Jun 1998 16:03:02 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: TIP: How to post good questions
Message-Id: <6n67hm$7gb$1@monet.op.net>


In article <fl_aggie-2406981247580001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>Dominus wrote:
>>``How do I use X to accomplish Y?'' There's nothing wrong with this,
>>except that sometimes X is a chocolate-covered banana and Y is the
>>integration of European currency systems.  

A less abominable example of this that comes up all the time is

	I have an array of strings.  How do I check whether the array
	contains a certain string?

Usually (not always, but usually) the *best* answer is to `unask the
question': 

	You should be using a hash, not an array.


I wish I had a convenient term for this kind of mistake.  The general
case is: 

	Someone wants to accomplish task Y.
	They determine that a way to accomplish Y is to use facility X.
	There is a sub-task of Y, say Z, for which X is ill-suited.
	They come into the group and ask `how can I use X to accomplish Z?''

This is a problem for people here trying to answer the real question,
which is:

	How can I accomplish Y?

But nobody can answer this question because the querent never
mentioned Y at all, and so nobody knows that the real goal is to
accomplish Y.  Instead, they are likely to get a long list of more or
less hacky ways to use X to accomplish Z, which is unfortunate.

A more experienced programmer would not have chosen to use X in the
first place.  A more experienced programmer would have determined that
W, not X, was the appropriate facility for accomplishing task Y.  

I like to try to guess Y, becayse I often feel that the best advice I
can give is `use W instead of X', and that the world is full of other
people who will suggest the hacky workarounds.  Guessing Y is very
diifficult and error-prone.  Worse, it's personally risky.  Even when
I am right, people may suspect that I'm being facetious.  (``The guy
asked a perfectly clear question; why didn't you answer it?'')  When
I'm wrong, it's even worse, because I can't defend myself against
charges of facetiousness by pointing out that my advice was good.

Of course, the environment we have here where people do make facetious
answers is conducive to that sort of misunderstanding.  I wish people
wouldn't do that, because it makes the environment distrustful, and
the risky answers that I like to give are unsafe in such a distrustful
environment.








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

Date: 28 Jun 1998 16:40:37 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: TIP: How to post good questions
Message-Id: <6n69o5$7m6$1@monet.op.net>


In article <fl_aggie-2406981247580001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>Repost, time..and yes, Olga, there *are* stupid questions.

Since I wrote that, I've found a few more.  Right now the #1 on my
shit list are the ones that invent some new syntax out of whole cloth,
and then are puzzled when it doesn't work.

	Why doesn't %h{@list} work?

	Why doesn't ('foo', ('bar', 'baz')) work?

	Why doesn't *#$*NJK@DN(D@HC work?

And gosh, it sure is hard not to be sarcastic here:

	``Because it's a syntax error.''

	``Because this is Perl, not Lisp.''

	``Because the computer can't read your mind.
	  Guess what?  We can't read your mind EITHER.''

	``But it *does* work.  It just doesn't do what you wanted.
	  There is a difference, you know.''

	``If your problem is how to keep the computer from exploding
	  when you do that, be sure to call the frobnitz() function.''

I think it must be something about the phrasing that gets me in the
sarcasm gland.  

It's so easy to fix these!  The maxim here is

	CARDINAL RULE OF REPORTING TECHNICAL PROBLEMS:

	Never, never, never, never, never say `doesn't work'.

	Never.

	PROPER PROPHYLAXIS:

	Just say ``I wanted X, but it does Y.  How do I get X?''

By just including some tiny hint about X, you turn a stupid question
into an intelligent one.

Here's an example from a couple of weeks ago:
>Why does this:
>
>    while ( ($k, $v) = each $this->{'stopped_content'}->{} ){
>        print       $v;
>       }
>not run?

Answer: ``Because it's a syntax error.''

Actually, the author here did do the right thing.  The original text was:

>Why does this work:
>
>    foreach $key (@keys){
>        print $this->{'stopped_content'}->{$key};
>        }
>But this:
>
>    while ( ($k, $v) = each $this->{'stopped_content'}->{} ){
>        print       $v;
>       }
>does not run:

And then the answer becomes ``You should have used
%{$this->{'stopped_content'}}''.  See the difference here?  One
question can be answered; the other can't.

Here's another recent one:

>i get errors when i try:
>/BOB/d;

Answer: ``Yes, that's what's supposed to happen.''

I am happy to report that the original author did actually include X:

>i get errors when i try:
>/BOB/d;
>trying to delete all BOBs from my file

The answer is now clear: ``Use `print unless /BOB/...' blah blah or
see perlfaq5 `How do I delete a line in a file' ''

I don't have many examples where the author really blew it, because I
try not to answer those questions.  I figure that even if I don't,
someone else will come along and say ``BECAUSE YOU CAN'T JUST MAKE
SHIT UP AND EXPECT THE COMPUTER TO MAGICALLY KNOW WHAT YOU MEAN,
RETARDO!''.  And even if nobody does cme along and say this, that's
not a bad thing.

Well, here's one I was able to dig up from last month:

Xxxx Xxxxxx wrote:
> I've written a routine to get the file size of each file within a
> specific directory.
> however, it only works on particular files.  There doesn't seem to
> be a pattern either.  I'm using NT as a platform.
> Any suggestions ?

Dear Xxxx,

Perhaps your veeblefitzer is clogged.



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

Date: 28 Jun 1998 21:08:50 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: mjd@op.net (Mark-Jason Dominus)
Subject: Re: TIP: How to post good questions
Message-Id: <g1gpklhp.fsf@mailhost.panix.com>

mjd@op.net (Mark-Jason Dominus) suggests:

> YOU CAN'T JUST MAKE SHIT UP AND EXPECT THE COMPUTER TO MAGICALLY
> KNOW WHAT YOU MEAN, RETARDO!

Or, as we say in c.l.p.m., YCJMSUAETCTMKWYMR.  Has a nice ring to it,
somewhat like TMTOWTDI, only bigger.  Say along with me,

            "Yik-Jim-Su-Eyuhtick-Tim-Kwimmer"

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Mon, 29 Jun 1998 02:28:57 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: TIP: How to post good questions
Message-Id: <6n6u91$k9q$1@ligarius.ultra.net>

Jonathan Feinberg <jdf@pobox.com> wrote:
-> mjd@op.net (Mark-Jason Dominus) suggests:
-> 
-> > YOU CAN'T JUST MAKE SHIT UP AND EXPECT THE COMPUTER TO MAGICALLY
-> > KNOW WHAT YOU MEAN, RETARDO!
-> 
-> Or, as we say in c.l.p.m., YCJMSUAETCTMKWYMR.  Has a nice ring to it,
-> somewhat like TMTOWTDI, only bigger.  Say along with me,
-> 
->             "Yik-Jim-Su-Eyuhtick-Tim-Kwimmer"

I love it. I may even name my first child "Yik-Jim-Su-Eyuhtick-Tim-Kwimmer".


Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: 28 Jun 1998 23:47:44 -0500
From: Tushar Samant <scribble@pobox.com>
Subject: Re: TIP: How to post good questions
Message-Id: <6n769g$qrc@tekka.wwa.com>

birgitt@my-dejanews.com writes:
>[snipped away - an outstanding effort and tremendous amount of caring]

And a prodigious amount of verbosity. No MJD-style elaborate
digressive discursion can withstand more than 3 reposts. Axe
it down to a third its size and post it 4 times a year or
something. Not to play down the effort or caring -- but way
too long.



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

Date: Mon, 29 Jun 1998 06:55:09 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: TIP: How to post good questions
Message-Id: <ebohlmanEvAwJy.E71@netcom.com>

Mark-Jason Dominus <mjd@op.net> wrote:
: I wish I had a convenient term for this kind of mistake.  The general
: case is: 

: 	Someone wants to accomplish task Y.
: 	They determine that a way to accomplish Y is to use facility X.
: 	There is a sub-task of Y, say Z, for which X is ill-suited.
: 	They come into the group and ask `how can I use X to accomplish Z?''

: This is a problem for people here trying to answer the real question,
: which is:

: 	How can I accomplish Y?

: But nobody can answer this question because the querent never
: mentioned Y at all, and so nobody knows that the real goal is to
: accomplish Y.  Instead, they are likely to get a long list of more or
: less hacky ways to use X to accomplish Z, which is unfortunate.

I think the term you're looking for is "premature closure"; the poster 
has decided on a solution without having completely specified the 
problem.  Diane Wilson, who sometimes hangs around in 
comp.infosystems.www.authoring.html, came up with "solutions as 
requirements" though that usually refers to a similar mistake at a 
higher, less detailed, level.

If you can tolerate a more verbose phrase, I'd suggest that "trying to 
fit the task to a chosen set of tools, rather than choosing the tooset 
based on the task" would be a good description.



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

Date: Mon, 29 Jun 1998 09:54:29 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: TIP: How to post good questions
Message-Id: <35975645.F0BF6F60@nortel.co.uk>

Eric Bohlman wrote:
> 

> If you can tolerate a more verbose phrase, I'd suggest that "trying to
> fit the task to a chosen set of tools, rather than choosing the tooset
> based on the task" would be a good description.

Fits the shoe. And that is because a beginner has got a restricted set of the
toolbox. Therefore a beginner tends to make its choice of tools first, and then
tries to accomplish the task with that tool, even if it makes his/her life a lot
harder. A good suggestion would be to just read, simply read a book like
'Programming Perl'. Even if you don't understand quite a few things, just flick
through, so that you at least know if there might be some other tool.

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Mon, 29 Jun 1998 12:34:59 GMT
From: birgitt@my-dejanews.com
Subject: Re: TIP: How to post good questions
Message-Id: <6n81lk$sbt$1@nnrp1.dejanews.com>

In article <6n769g$qrc@tekka.wwa.com>,
  scribble@pobox.com wrote:
>
> birgitt@my-dejanews.com writes:
> >[snipped away - an outstanding effort and tremendous amount of caring]
>
> And a prodigious amount of verbosity. No MJD-style elaborate
> digressive discursion can withstand more than 3 reposts. Axe
> it down to a third its size and post it 4 times a year or
> something. Not to play down the effort or caring -- but way
> too long.
>
>

I think that this autopost is designed to make clear to a poster,
who got a sarcastic response to his question, why that happened.

In my opinion, yes, it could/should be shorter, but the emotions
shining  through in the elaboration of the whole piece is what
makes the difference.

So, don't cut what is important: the examples and the 'sigh'-
reactions to them. The goal is to let out and explain the reason
for 'the sarcasm' here, in an impersonal autopost, which should
catch a newbies eye often and should be explicit.

At least that is the only reason I suggested to post it _often_.
If a newcomer who is a bit upset about the sarcasm of some re-
sponders can't help but running into this autopost, he will
'get the picture' very fast.

The autopost is not designed for other people. They can skip it.
The subject line should be more clear, IMHO.

For example: SOME QUESTIONS CAUSE SARCASTIC ANSWERS. WHY ?

Birgitt Funk

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 29 Jun 1998 13:55:24 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: TIP: How to post good questions
Message-Id: <35978EBC.24A5920A@nortel.co.uk>

Jonathan Feinberg wrote:
 
> > YOU CAN'T JUST MAKE SHIT UP AND EXPECT THE COMPUTER TO MAGICALLY
> > KNOW WHAT YOU MEAN, RETARDO!

YCJMSUAETCTMKWYMR => YC-JM-SU-AETC-TM-KWYMR

>             "Yik-Jim-Su-Eyuhtick-Tim-Kwimmer"

message has been duly filed for later reference. The constant struggle to keep
up with weird jargon. Ts, I don't know...


-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Mon, 29 Jun 1998 09:27:06 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: TIP: How to post good questions
Message-Id: <fl_aggie-2906980927060001@aggie.coaps.fsu.edu>

In article <6n6u91$k9q$1@ligarius.ultra.net>, sowmaster@juicepigs.com (Bob
Trieger) wrote:

+ Jonathan Feinberg <jdf@pobox.com> wrote:

+ ->             "Yik-Jim-Su-Eyuhtick-Tim-Kwimmer"

+ I love it. I may even name my first child "Yik-Jim-Su-Eyuhtick-Tim-Kwimmer".

I believe that would be considered a form of child abuse.

James


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

Date: Mon, 29 Jun 1998 09:29:52 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: TIP: How to post good questions
Message-Id: <fl_aggie-2906980929530001@aggie.coaps.fsu.edu>

In article <6n67hm$7gb$1@monet.op.net>, mjd@op.net (Mark-Jason Dominus) wrote:

+ A less abominable example of this that comes up all the time is
+ 
+         I have an array of strings.  How do I check whether the array
+         contains a certain string?
+ 
+ Usually (not always, but usually) the *best* answer is to `unask the
+ question': 
+ 
+         You should be using a hash, not an array.

+ I wish I had a convenient term for this kind of mistake.

Call it 'Hammer-Nails' as in 'When all you have is a hammer, before long
all your problems start looking like nails'.

James


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

Date: 29 Jun 1998 21:09:38 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: TIP: How to post good questions
Message-Id: <6n9dsi$ggg$1@monet.op.net>


In article <ebohlmanEvAwJy.E71@netcom.com>,
Eric Bohlman  <ebohlman@netcom.com> wrote:
>I think the term you're looking for is "premature closure"; 

Wunderbar.  Thanks!

>If you can tolerate a more verbose phrase, I'd suggest that "trying to 
>fit the task to a chosen set of tools, rather than choosing the tooset 
>based on the task" would be a good description.

We can abbreviate this to `Maslowfying'. 



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

Date: 29 Jun 1998 21:45:21 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: TIP: How to post good questions
Message-Id: <6n9fvh$gn0$1@monet.op.net>


In article <6n81lk$sbt$1@nnrp1.dejanews.com>,  <birgitt@my-dejanews.com> wrote:
>I think that this autopost is designed to make clear to a poster,
>who got a sarcastic response to his question, why that happened.

No thanks.  I don't want anything I wrote to be used to justify
rudeness and sarcasm.


Actually, one reason I've never reposted this article myself is that
the problem it addresses doesn't really come up very often.  The
inspiration for it was that guy who wanted to use Perl to collect
email addresses. 

It's fun, and people seem to like it, but I don't think it would be
very helpful.




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

Date: 30 Jun 1998 09:05:32 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: TIP: How to post good questions
Message-Id: <r8zpevg4sb.fsf@asc.sps.mot.com>

birgitt@my-dejanews.com writes:

> In article <6n769g$qrc@tekka.wwa.com>,
> The autopost is not designed for other people. They can skip it.
> The subject line should be more clear, IMHO.
> 
> For example: SOME QUESTIONS CAUSE SARCASTIC ANSWERS. WHY ?

EXCELLENT idea.  Is the right person listening, who can make this
change?

Martin.


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

Date: Tue, 30 Jun 1998 06:55:52 GMT
From: birgitt@my-dejanews.com
Subject: Re: TIP: How to post good questions
Message-Id: <6na25o$qf0$1@nnrp1.dejanews.com>

In article <6n9fvh$gn0$1@monet.op.net>,
  mjd@op.net (Mark-Jason Dominus) wrote:
>
>
> In article <6n81lk$sbt$1@nnrp1.dejanews.com>,  <birgitt@my-dejanews.com>
wrote:
> >I think that this autopost is designed to make clear to a poster,
> >who got a sarcastic response to his question, why that happened.
>
> No thanks.  I don't want anything I wrote to be used to justify
> rudeness and sarcasm.

You are right, I certainly wouldn't want that either, but seriously
hadn't thought that someone could use your piece as a justification
for being sarcastic or rude.

>
> Actually, one reason I've never reposted this article myself is that
> the problem it addresses doesn't really come up very often.

I am glad you say this. I am not long enough reading c.l.p.m. to
know. May be the last couple of weeks or months had an unusual
amount of heated 'off-topic' issues, more than usual ?


> It's fun, and people seem to like it, but I don't think it would be
> very helpful.
>

Just to recap shortly for the record. During my lurking time I
personally have gotten caught in some plain talk/semi-sarcastic
remarks in response to what I would call 'off-topic' issues.

As both Tom Phoenix and Tom Christiansen were so open-minded and
kind to ask for suggestions what one could post which would
help newbies, I felt compelled to think about it.

I was seduced into believing for two days that there might be
a solution. But it fell apart as soon as I tried to put it
in writing. I had to resort into prayers. :-)

So, basically I have no idea what to post in an open c.l.p.misc
group which would help preventing newbies from asking FAQ questions
and a couple of 'gimme, gimme' bypassers from getting a deal.

All I can suggest is posting something which works as a mirror
and makes a newbie do some soul searching _after_ the mess
has occurred.

But I wouldn't spend time of putting something together if
a moderated group is being established. One could give it some
more thought if one would have to live exclusively with c.l.p.m
in the future.

Birgitt Funk




-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 29 Jun 1998 17:31:13 -0700
From: Richard Remington <rremington@westaff.com>
Subject: Title Caps
Message-Id: <359831C3.45E05923@westaff.com>

I've been working on a something I'm sure someone has done before. I'm
pulling ascii data from an Oracle database using DBI. The data I get is
sometimes all caps, sometimes lower case, and sometimes title caps. I
want to convert everything to lower case and then convert to title caps.
The following code is messy and requires that I type it out for every
scalar I pull from the database. I know I can clean this up and find a
less cumbersome solution but I'm asking if anyone has done something
like this if they can help because I need to include this feature in a
project whose deadline is fast approaching. I want to have a function
that I run every scalar through to convert it to title case.

$city =~ tr/A-Z/a-z/;                             # Convert string to
all lower case.
($part1, $part2, $part3) = split / /, $city; # There may be more than
one word in the scalar.
substr($part1,0,1) =~ tr/a-z/A-Z/;           # Convert the 1st three to
title caps.
substr($part2,0,1) =~ tr/a-z/A-Z/;           # but what if there were
four words?
substr($part3,0,1) =~ tr/a-z/A-Z/;           # Keep typing this line
forever?
$city = join ' ', $part1,$part2,$part3;       # Put the title capped
pieces back together again.

If $city were SIOUX CITY, it would become sioux city and then Sioux City
but there has to be a more elegant way especially with 20 fields per
entry. Any help is greatly appreciated.

Richard
Webmaster
Western Staff Services



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

Date: Mon, 29 Jun 1998 18:41:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Title Caps
Message-Id: <MPG.1001e21e33436b829896d6@nntp.hpl.hp.com>

In article <359831C3.45E05923@westaff.com> on Mon, 29 Jun 1998 17:31:13 -
0700, Richard Remington <rremington@westaff.com> says...
 ...
> $city = join ' ', $part1,$part2,$part3;       # Put the title capped
> pieces back together again.
> 
> If $city were SIOUX CITY, it would become sioux city and then Sioux City
> but there has to be a more elegant way especially with 20 fields per
> entry. Any help is greatly appreciated.

join ' ', map ucfirst lc, split;

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


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

Date: 30 Jun 1998 05:03:19 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Title Caps
Message-Id: <6n9rin$cur$1@marina.cinenet.net>

Larry Rosler (lr@hpl.hp.com) wrote:
: In article <359831C3.45E05923@westaff.com> on Mon, 29 Jun 1998 17:31:13 -
: 0700, Richard Remington <rremington@westaff.com> says...
: ...
: > $city = join ' ', $part1,$part2,$part3;       # Put the title capped
: > pieces back together again.
: > 
: > If $city were SIOUX CITY, it would become sioux city and then Sioux City
: > but there has to be a more elegant way especially with 20 fields per
: > entry. Any help is greatly appreciated.
: 
: join ' ', map ucfirst lc, split;

That is, reading from right to left:

1. Split the string into 'words' on whitespace.
2. Map 'ucfirst lc' over the list of words.  lc lowercases the
   entire word, then ucfirst uppercases the first char.
3. Join the transformed words back into a scalar, separated by
   single spaces.

AWTDI, which preserves the original's spacing, is

  s/(\w+)/\u\L$1/g;

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Thu, 25 Jun 1998 10:26:42 +0200
From: Alessandro Forghieri <alf@orion.it>
Subject: Re: trying to run a unix prog with perl
Message-Id: <359209C2.9950FB09@orion.it>

Greetings.

Dolores D. Alcazar wrote:
>     I'm trying to run htpasswd with a perl script.  Its a simple program in
[...]
> passwords (you have to enter it manually).  I can't seem to figure out what
> I've done wrong... Please help... thanks


I *think* that is because htpasswd, as many password programs, do not
read their input
from STDIN. They read it from /dev/tty (or somesuch) so they can hide
the password
you are typing. This is the reason things like the one you are trying to
do
are often done with expect.
I remember having seen a reference to a module (HTTP:Htpasswd ???) that
can be found 
on CPAN & will probably fill your needs.

HTH & cheers,
	Alessandro


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

Date: Mon, 29 Jun 1998 20:43:10 -0700
From: "Darren Sweeney" <darrensw@pacbell.net>
Subject: Two commands, one button.
Message-Id: <6n9n2s$7pg$1@nnrp3.snfc21.pbi.net>

I am currently reconfiguring a script, the question I have is can one submit
button perform two functions, one after the other.

e.g. I have one button which submits data to a HTML screen and another that
then takes me to that screen

    <INPUT TYPE = "submit" NAME = "add_to_form" VALUE = "Add Data">
    <INPUT TYPE = "submit" NAME = "view_form" VALUE = "View Form">

Can the value function accept two commands, if so what is the divider?

Thanks,

Darren





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

Date: Tue, 30 Jun 1998 03:58:49 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Two commands, one button.
Message-Id: <Pine.GSO.3.96.980629205741.17225N-100000@user2.teleport.com>

On Mon, 29 Jun 1998, Darren Sweeney wrote:

> I am currently reconfiguring a script, the question I have is can one
> submit button perform two functions, one after the other. 

It sounds as if you want your browser to do something. The docs, FAQs, and
newsgroups about browsers and related issues should be able to help you
get a better and more-complete answer than we can give here. Good luck!

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



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

Date: Tue, 30 Jun 1998 10:19:49 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Two commands, one button.
Message-Id: <3598ADB4.AF07DBEF@nortel.co.uk>

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________
Darren Sweeney wrote:

> e.g. I have one button which submits data to a HTML screen and another that
> then takes me to that screen
> 
>     <INPUT TYPE = "submit" NAME = "add_to_form" VALUE = "Add Data">
>     <INPUT TYPE = "submit" NAME = "view_form" VALUE = "View Form">
> 
> Can the value function accept two commands, if so what is the divider?
> 
> Thanks,
> 
> Darren

In one of my scripts I have something like this:

  print $layout->submit('action','Add new entry');
  print $layout->submit('action','Delete existing entries');

Which creates two submit buttons. Their name is the same, their values, however,
are different. Further up in the program I then have something like that:

  &add_entry		if  $layout->param('action') eq 'Add new entry';
  &delete_entries	if  $layout->param('action') eq 'Delete existing entries';

I am using CGI.pm. That should answer your question.

____________________________________________________________
Frank Quednau                     
http://www.surrey.ac.uk/~me51fq   
________________________________________________


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

Date: 30 Jun 1998 15:07:51 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Two commands, one button.
Message-Id: <oee90mfnld4.fsf@alpha.hut.fi>


"Darren Sweeney" <darrensw@pacbell.net> writes:
: 
: I am currently reconfiguring a script, the question I have is can one submit
: button perform two functions, one after the other.
: 
: e.g. I have one button which submits data to a HTML screen and another that
: then takes me to that screen
: 
:     <INPUT TYPE = "submit" NAME = "add_to_form" VALUE = "Add Data">
:     <INPUT TYPE = "submit" NAME = "view_form" VALUE = "View Form">
: 
: Can the value function accept two commands, if so what is the divider?

I seen no Perl in the above.  I see comp.infosystems.www.authoring.cgi.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 30 Jun 1998 16:07:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Two commands, one button.
Message-Id: <6nb2f6$368$1@client3.news.psi.net>

Darren Sweeney (darrensw@pacbell.net) wrote on MDCCLXIV September
MCMXCIII in <URL: news:6n9n2s$7pg$1@nnrp3.snfc21.pbi.net>:
++ I am currently reconfiguring a script, the question I have is can one submit
++ button perform two functions, one after the other.
++ 
++ e.g. I have one button which submits data to a HTML screen and another that
++ then takes me to that screen
++ 
++     <INPUT TYPE = "submit" NAME = "add_to_form" VALUE = "Add Data">
++     <INPUT TYPE = "submit" NAME = "view_form" VALUE = "View Form">
++ 
++ Can the value function accept two commands, if so what is the divider?
++ 


And your Perl question is?

(As for your question, it phrased dramatically wrong. If you mean what
I think you mean, the answer is yes. And the "divider" is that data
being send)


Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 30 Jun 1998 11:14:40 +0400
From: "Adam Wakal" <awakal@interactive.net>
Subject: UNIX to NT changing cgi script
Message-Id: <01bda444$989847d0$0b02a8c0@titanium>

Hello Able Ones

I moved a cgi script from UNIX to NT and can't get the sendmail
portition to work.

I changed the path name but it comes back with a Recipent names need to be
specified error in the event viewer.

Any one have experience using perl on NT with sendmail?

Adam


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

Date: Tue, 30 Jun 1998 08:43:28 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Adam Wakal <awakal@interactive.net>
Subject: Re: UNIX to NT changing cgi script
Message-Id: <359907A0.268C7AEC@sirius.com>

Adam Wakal wrote:
> 
> Hello Able Ones
> 
> I moved a cgi script from UNIX to NT and can't get the sendmail
> portition to work.
> 
> I changed the path name but it comes back with a Recipent names need to be
> specified error in the event viewer.
> 
> Any one have experience using perl on NT with sendmail?
> 
> Adam

As far as I know there is no "sendmail" program on NT.  Some people
use blat, others connect to sendmail running on a remote machine using
the Net::SMTP module.  I recently wrote a module that will allow you
to use either solution and include attachments.  I will send it to
you if you want.

-- Jim Bowlin


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

Date: Sun, 28 Jun 1998 11:36:35 GMT
From: debel@bigfoot.com
Subject: Re: Uploading perl scripts with a perl script.
Message-Id: <6n59s3$sh7$1@nnrp1.dejanews.com>

In article <6mej6e$ioo$1@nnrp1.dejanews.com>,
  rpearce@my-dejanews.com wrote:
>
> Senario:  Need to upload a perl script to my ISP's server from work.  Work is
> behind a firewall and I can't use ftp/wsftp (tried several firewall settings,
> but none work)

Try the shareware program, CuteFTP or the FTP client in Windows 95 from the
command line. I often use both of these methods to test CGIs for work before
posting on our corporate server -- and I do this from behind our firewall.

> The upload and/or create works, but when I try to run the script I get an
> error message:
>
> CGIwrap Error: System Error: execv() failed
> Error: No such file or directory (2)
> I believe the second line is referring to the shebang line in the script. It
> can't find perl because of (possibly?) an added \r ?maybe?

Usually, at least with my ISP, I get this error due to an error I introduced
in my script. More often than not it has something to do with the shebang
line, just as you surmised. Your shebang line should look something like
this:

#!/usr/local/bin/perl

You should contact your ISP and ask them how the shebang line should look.

HTH,

-=Daniel

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

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

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