[8478] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2095 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 13 23:07:20 1998

Date: Fri, 13 Mar 98 20:00:23 -0800
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, 13 Mar 1998     Volume: 8 Number: 2095

Today's topics:
        Deleting Current Line of File Read <e.phillips@mindspring.com>
        Embedded Data file in script <yashesh@eecs.berkeley.edu>
    Re: Help ! I'm begginer..... <chasecreek.systemhouse@usa.net>
    Re: Help sought with web programming security problem <chasecreek.systemhouse@usa.net>
    Re: How to use Perl for Win95? <sp17@cornell.edu>
    Re: Is there a "Newsgroup" for Newbies to Perl? (Nicholas Carey)
    Re: Is there a "Newsgroup" for Newbies to Perl? <chasecreek.systemhouse@usa.net>
        Naming Quandry shaker@netusa1.net
    Re: Netscape & x-mac-creator=\"426C5764\" <chasecreek.systemhouse@usa.net>
    Re: NT: How do I set permissions on a file? <bowlin@sirius.com>
    Re: PATH_INFO&STRING_QUERY <chasecreek.systemhouse@usa.net>
    Re: Perl For Windows NT (root)
    Re: Redirecting to a script on another server. <chasecreek.systemhouse@usa.net>
    Re: Reference to a part of a hash? <beans@bedford.net>
    Re: Trimming a Variable (David Oswald)
    Re: User-interface Quandary (Abigail)
    Re: User-interface Quandary shaker@netusa1.net
    Re: User-interface Quandary <chasecreek.systemhouse@usa.net>
    Re: Using regex to initial cap a name (David Oswald)
    Re: Web based File manipulation on NT?? Help? <chasecreek.systemhouse@usa.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 13 Mar 1998 22:38:59 -0500
From: "Eric Phillips" <e.phillips@mindspring.com>
Subject: Deleting Current Line of File Read
Message-Id: <6ecuo0$98c@camel20.mindspring.com>

Hello.  I am pretty new to Perl, and have a problem that I need some
explaining.  I have a script that is working great  so far until I have to
write a new line to the file that I just read the old line from.  I need to
delete the current line of text that I just read from, and replace it with
the new one.  How do I do that?  Please let me know.  Thanks!

--
Eric Phillips
e.phillips@mindspring.com




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

Date: Fri, 13 Mar 1998 19:13:02 -0700
From: Yashesh Shroff <yashesh@eecs.berkeley.edu>
Subject: Embedded Data file in script
Message-Id: <3509E7AE.F6C8DD83@eecs.berkeley.edu>

Hi all!
We can embed data at the end of a perl script and read it off.  This
way, data and script remain in one file only.  I was wondering, is there
anyway we can *add* or *change* the information in the data section of
the file?  For example, can I change the last data line of the following
file?
#----------------
$sum = 0;
while (<DATA>) {
  next unless  /Expense\s+(\d+\.\d+)/;
  $sum = $sum + $1;
}
  print DATA "TOTAL = $sum\n";        #???? This is not legit, but I
want to do something like this
__END__
%This is my data file
Expense    12.23
Expense     33.55
Expense    22.54
<CAN I ADD A TOTAL LINE HERE??>




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

Date: Sat, 14 Mar 1998 02:37:29 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Help ! I'm begginer.....
Message-Id: <3509EC21.544BD4F1@usa.net>

I hazard a guess that the problem is in the part of the code
you didn't provide.

Report formats are not exactly 'executed',
not per se...

Sorry,
Sneex :)

T.S.Belle wrote:

> it don't work , i don,t know why....
> Please , help me...(I'm fresh for Perl) :-)
>
> ==================================
>
> #....somecode....
> write;
> }
> format STDOUT =
> @<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<<<
> $lastname ,$name,$phone
> .
> format STDOUT_TOP =
> Page @<<
> $%
> Firstname                                            Name             Phone
> =================== ================    ========
> .
>
> belle@iki.rssi.ru





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

Date: Sat, 14 Mar 1998 02:42:19 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Help sought with web programming security problem
Message-Id: <3509ED42.7F3DD96C@usa.net>

As the others respondants have mentioned, this is
off topic for this group;  see a CGI-related group.

However, if you think about what you are trying to
do, you would have the non-stealable (hopefully)
CGI securely serve any information you feel is
appropriate to leak over the almost non-securable
WWW :)  If you think long enough you will see
a way to accomplish it.

HTH,
Sneex :)

PS -  A hint:  To serve secure data,
it must be served from a non-servable place &
by your CGI ONLY... :)


Woody Durham wrote:

> I am in need of a way of providing web page readers with a visual
> certification that they are viewing an "official" web page and
> not someone's copy of it. I have been thinking along the lines
> of developing a "seal of approval" gif file image which will be kept
> secure. At the top of each web page using this scheme would be a request
> to a CGI program for the "seal of approval" image. If the requesting
> page were a "proper" one (i.e. located on the secured server rather
> than on someone's own server) the program would return the gif file.
> Otherwise, the program would return a different "seal of unapproval"
> gif file contents.
>
> So, can one do this and if so how or what might be another approach?





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

Date: Fri, 13 Mar 1998 21:04:15 -0500
From: "Steve Pacenka" <sp17@cornell.edu>
Subject: Re: How to use Perl for Win95?
Message-Id: <6ecoi7$jv6@newsstand.cit.cornell.edu>

Maxine G. <*nospam*mg*nospam*@*nospam*pcg*nospam.net> wrote:

>I think I'm missing a very basic concept:
>I've downloaded and installed the Activestate Win32 version of Perl and
>PerlScript on my Win95 machine. Now what do I do? If I double-click on any
of
>the three .exe files in the bin directory, a dos window opens briefly and
then
>closes.
>So, what do I need to do to create and run perl scripts in this
environment? I
>couldn't find anything about this in the documentation, but perhaps I
wasn't
>looking in the right place.It seems like such an obvious question, so I
assume
>that the answer must be obvious too.


Square one.  The Perl.exe you installed is a "Win32 console" program.  It
runs under a MS-DOS prompt when you type "perl".  If it got installed
correctly, you can open a DOS prompt and type:

      perl -e "print 'hello world';"

to run your first Win32 Perl script.


Square 2.  Create a script file with any plain text editor.  Windows notepad
is okay for short Perl scripts, except that it sometimes adds its own ".txt"
to the end of file names.

To run a script in a file called hello.pl, load a MS-DOS prompt and do:

      perl hello.pl

-- good luck, SP





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

Date: Sat, 14 Mar 1998 00:44:41 GMT
From: a-bnc@microsoft.com (Nicholas Carey)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <3509b584.19396625@newsvr>

On Fri, 13 Mar 1998 09:45:36 -0600, Mark P Stackhouse
<stackhou@elk.cray.com> wrote:

>David Oswald wrote:
>
> > 
> > But don't you understand?  This isn't a helpdesk.
>
> My point exactly!  We need a "helpdesk"!
>
> > I've been putting in the effort; got a minor in Comp. Sci.,
> > read cover to cover (and re-read) the Camel, Llama, Owls, and
> > Mouse books, spent a lot of time at www.perl.com, worn holes
> > in the soles of DejaNews,
>
> Do you really expect a "Newbie" to buy and read 4 books at the
> same time?  I have, and am reading "Learning Perl", but I still
> get confused sometimes.  Sorry, but my mind isn't a steel trap!
> I DO, use the resources available on-line but they're not very
> friendly... to a "Newbie", the answer can be more confusing
> than the question.  All we get from the docs is the syntax...
> very few examples to learn from.

To my knowledge, there is no one regularly posting to this
newsgroup (and quite a few who no longer read this newsgroup)
who have a problem with helping newcomers to Perl. What they do
have a problem with is, among others:

* answering the same questions, over and over and over again.
  After all, there is a reason why they are called *Frequently*
  Asked Questions.
* answering questions having little to nothing to do with Perl
  (eg, "How do I do ftp with Perl?" Answer: the same way you'd
  do ftp with any other language -- open up a socket to the
  proper server/port and read/write from it.)
* wading through and sorting megabytes of the same in order to
  extract the small percentage of questions/issues that are of
  import in order to help them.

Nobody who reads and/or posts to this group (or any other
newsgroup, for that matter) gets paid to do so -- to a woman
[thanks, Abigail!], they do so because they want to, and for
whatever reason, derive something out of helping others.
Answering the same question over and over again is *really*
wearying . Have you ever worked a helpdesk? The burnout level is
as high as it is for good reason.

A *lot* of work has gone into producing Perl's plethora of
documentation. It may not be the most usable documentation set on
the planet -- but you owe it both to yourself and to the USENET
community to research your question before asking it of the world
and expecting a stranger to interrupt his work to answer a
qeustion, the answer to which is readily available in a number of
different places. Remember, USENET only helps those who (A) help
themselves and (B) help others.

>From your paragraph above ("not very friendly", "answer...more
confusing than the question", "all we get is syntax...very few
examples"), it sounds as if you'd be happier with documentation
presuming less pre-knowledge of the topic.

Technical documentation is *really* quite difficult to write and
write well, especially if writing to beginners. If one groks
(understands deeply) something, it can be very difficult to
explain it to someone who knows nothing about it, because things
that are intuitively obvious aren't so to the person to whom it
is being explained. A newbie, having recently reached
understanding, may well have a better grasp of *how* to explain a
concept to another newbie than the originator of the topic,
because the newbie has a better memory of groping blindly in the
dark and what was mysterious and confusing.

Join the Perl community and make the documentation better! When
you've struggled through the documentation and reached [what you
think is] understanding about a topic, take a moment.

Try to figure out what made that concept hard to understand and
how it could be better explained. Suggest any changes you think
are useful to the author/maintainer for possible inclusion.

> > ...and asking questions here isn't really going to help you
> > to learn the language.  You'll learn the answer to your
> > question (maybe) but not how to think in Perl.  You can only
> > learn that through time-consuming study.
>
> Agreed... but when you're attempting something new, you want to
> see results... I guess I'm a little impatient that way.  After
> all... isn't that why Perl was developed in the first place...
> to get results quickly?

Err...USENET would be a bad place to look for quick answers. I
know I can find the answer to most of the things I want to know
faster by looking in the online docs, the Llama or the Camel
rather faster than I can expect an answer from the hive mind of
USENET.

> > >We need a good list of tutorials, our own Newsgroup, some
> > >good books, and a few  mentors who don't mind answering (and
> > >explaining) our "Newbie" questions.  Then we get out of your
> > >bandwidth.
> > 
> > A newbie newsgroup would indeed be a nightmare; a zillion
> > questions (not unlike this group's current state of affairs)
> > and a half zillion wrong answers.  Go to the books; that's
> > where you'll find the truth.

Exercise: Why does USENET have [at best] few-to-no
*.(newbie|beginner) newsgroups? Summarize in 25 word or less.

Fundamentally, it's the same problem you'd face if *.guru
newsgroups were created: they act as a magnet for J. Clueless.
Newbie. The Signal/Noise ratio would rapidly approach zero.
End result: the clueless leading the ignorant -- nobody with a
clue would read the group. Too much dross, not enough gold.

In summary, the FAQs and the documentation are the newbie's
helpdesk. Instead posting the usual newbie-style FAQ:

  TO: comp.lang.perl.misc
  SUBJECT: !!!EMERGENCY!!! Newbie In trouble!

  how do I round a number to 3 decimal places in Perl?
  -- 

Take a look at the documentation: the Llama, the Camel, the
[assorted] FAQs, the online documentation, www.perl.com. Struggle
through it. Try something. Look at what happened and how that
differs from the expected.

Back to the docs. Try to find an explanation for the discrepancy
in behaviour. Make the changes suggested by the new reading of
the docs. Repeat as necessary.

When you've exhausted all the apparent explanations, *then* (and
only then) pose a reasoned, specific question with a reasoned,
appropriate SUBJECT: line to the group (eg, "I'm trying to
accomplish X. I've tried Y: it doesn't do what I expected. I
expected M and got N. I've studied the FAQs and the documentation
and still don't understand what I'm doing wrong. Can somebody
explain this to me?"

You're virtually guaranteed better results from this approach.
And you'll have learned two things: (1) what you wanted to know
in the first place, and (2) greater insight into the
documentation. It's always been my experience that knowledge of
how to find the information you need is worth at least as much as
knowing it in the first place.

Cheers!

N.
-- 


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

Date: Sat, 14 Mar 1998 02:14:41 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <3509E6C8.3DE9E496@usa.net>

Hi All, I truly have to agree with Mr Feinberg's
point here.  A year ago I was 'just starting' out
as it were and many here would definitely say I
am still a newbie.  I have only written about
20 or so Perl programs, and to a point, have
asked someone at sometime a question or
two more than I probably should have.

But my point is, as someone in this thread
has already pointed out - people asking
these questions need to be prepared for
whatever answer they get - understandable
or not - good or bad.  We are all carbon
based and prone to hyper-reacting at times,
but 'A lack of planning on your part
does not constitute an emergency on
this Groups part.'

Be part of the solution by being prepared
for the answer(s.)  And please try not to
perpetuate flame threads.

And Yes, I am just as guilty as the rest
of you newbies, so the above applies to
me as well.  :)

Thx for listening,
Bill :)

Jonathan Feinberg wrote:

>    http://www.perl.com
>
> Now, nobody here minds answering questions.  But if a question is
> already answered in the documentation that accompanies perl, or --
> worse yet -- is in one of the FAQs, then people get impatient.  If you
> don't understand the *answer* that's in the documentation; if you need
> *clarification* on a technical point; if you need *further examples*
> of a usage, then by all means, post here.  But make sure you say "I've
> consulted perlfaq6 concerning multiline matches, and I still don't get
> the difference between /m and /s," or whatever, so we'll know 1) that
> you've at least tried to figure it out for yourself and 2) exactly
> where your confusion lies.





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

Date: Fri, 13 Mar 1998 19:24:43 -0600
From: shaker@netusa1.net
Subject: Naming Quandry
Message-Id: <6ecm68$hkn$1@nnrp1.dejanews.com>

I had responded a few minutes ago to a thread asking for alternate
names for some menu options.

I want to add to one of the suggestions I had made but cannot find
my article under MyDejaNews (my main newsreader). I don't want to
wait till it gets to DejaNews (the archives).

The third option could be:

   Match Phrase, as Only Item

The other two were:

   Match Letters

   Match Words

V. Chandrasekhar

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


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

Date: Sat, 14 Mar 1998 01:52:08 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Netscape & x-mac-creator=\"426C5764\"
Message-Id: <3509E180.CBC097D@usa.net>

Has nothing to do this this group!

But I was curious, so I would say after looking at it
on my Mac, that it is a problem with Claris, not Perl
nor Netscape, nor the creator type...

HTH,
Sneex :)

PS - Stay tuned, when our
Mac guru get's in Monday I
will know more...

PPS - Get Netscape,
it works wonderfully
on a Mac (as so much
does...)



Administrator wrote:

> x-mac-type=\"54455854\";
>  x-mac-creator=\"426C5764\"
>
> I use UNIX sendmail to attach and send an html file. I receive it with
> eudora on a macintosh. The corresponding file icon is not a netscape
> icon. (In teh case above - some form of Claris software) I need to know
> what codes correspond to an html file that will open netscape
> automatically when I double double click on the file.





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

Date: Fri, 13 Mar 1998 18:11:48 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: ZAC <zac@fiz-online.de>
Subject: Re: NT: How do I set permissions on a file?
Message-Id: <3509E764.9C5F2665@sirius.com>

Permissions under NT are always a real pain.  You need to
make sure that whoever is supposed to have permissions to
a file also has:

1) permissions in the containing directory
2) at least LIST permissions in all directories leading
   to the directory, including the drive letter.
3) permissions to "log on locally" set in the user manager.

One way to do this is to create a new group.  Give that
group the permissions above, and then make every user that
you want to give this permission to, a member of that group.

Good luck,

Jim Bowlin

ZAC wrote:
> 
> Hi,
> 
> I am trying to run an Email form script (perl) on a windows nt server
> (IIS). The problem is that the server asks for a password when the
> browser calls the script. If I give the (administrator) password, than
> the is form forwarded properly, otherwise I get the answer :
> connection refused. I have also changed the permission on the
> directory to full access for all users and all groups that I found on
> the NT-Server but it still do not work.
> 
> Please help. The script I am using is :
> 
> Form2Mail Form2Mail is ) Copyright 1997 by Eric T. Wienke and Liquid
> Silver that I found at http://www.4images.com/ntperl
> 
> Thanks.
> 
> ZAC


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

Date: Sat, 14 Mar 1998 02:23:04 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: PATH_INFO&STRING_QUERY
Message-Id: <3509E8C0.D99CC6F5@usa.net>

Off group topic, see a CGI-related group;

However, the problem here is one of understanding I believe.
With a GET/POST (they are the same, just that
one shows up on the URL line in the browser);
with either method the ? is a valid part of the URL in total.

Research CGI at CPAN via http://www.perl.com
See CGI.pm for further help.

HTH,
Sneex :)


Krishnan Venkatesan wrote:

> Dear perl programmer
> i am using env variables PATH_INFO & QUERY_STRING to send information
> pass info to a cgi.
> The problem i have is that if PATH_INFO contain question marks '?'
> incorrect info
> is send in the QUERY_STRING and PATH_INFO data has chopped off at the
> question.
> Is there an escape character like '\' that can be used in front of the
> '?' .
> Thanks
> Krishnan





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

Date: 14 Mar 1998 04:26:59 -0600
From: root@downy.wildwood.org (root)
Subject: Re: Perl For Windows NT
Message-Id: <350a0713.0@news7.kcdata.com>

Your script should go into InetPub/scripts instead of wwwroot/cgi-bin.  
You can create an alias for InetPub/scripts and call it cg-bin inside 
your server.  Seem to remember a checkbox to enable Perl on one of 
the server config screens also.

Luck,
Jim 

In article <6eatug$9sn@news.microsoft.com>,
	"Husky" <huskystudio@geocities.com> writes:
> This is my first time to try to use Perl on Windows NT platform.
> But when I use browser to see the result, it shows:
>     HTTP/1.0 501 Not Support
> 
> I write down my step and hope you can help me...
> 
> 1. launch Pw32i315.exe (1,510 KB) (Perl for Win32 Intel/x86 binary) and
> install Perl on my NT 4.0 successfully.
> 2. Prepare a HTML in my web (d:\InetPub\wwwroot) like this:
> 
> <form method="POST" action="http://husky/cgi-bin/comments.pl">
>   <p>Please :<input type="text" name="address" size="20"></p>
>   <p>Your Comments:</p>
>   <p><textarea rows="5" name="comments" cols="20" </textarea></p>
>   <p><input type="submit" value="Submit" name="B1">
>     <input type="reset" value="Reset" name="B2"</p>
> </form>
> 
> 3. Prepare a PL file named comments.pl in (D:\InetPub\wwwroot\cgi-bin) and
> jsut print something:
> 
> print <"EndOfMessage";
> <html>
> <head>
> <title>This is a test </title>
> </head>
> <body>
>  <h1>Hi</h1>
> </body>
> </html>
> EndOfMessage
> 
> 4. Browser HTML and click the Submit button.
> 
> Is there any steps I lost something?
> Please do me a favor...
> 
> Thanks
> Andrew Wang
> 
> 


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

Date: Sat, 14 Mar 1998 02:48:00 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Redirecting to a script on another server.
Message-Id: <3509EE97.9BD247D5@usa.net>

Off topic, see CGI-related ng:

However, I have several security scripts
which like to play tennis with each other; so
if you could post some code of how you
are trying this maybe we could point
out something.

The short answer is it works for me,
what are you doing wrong or otherwise?

Could be a firewall issue, or any number of
other things...

HTH,
Sneex :)

Grahame S Cooper wrote:

> This could be a Perl question or a CGI question.
> Apologies if it is off topic.
>
> I want to redirect from a Perl CGI script to another one
> on a different server.
>
> I have tried using the Location: directive, but it
> doesn't seem to work for this purpose, and I can't see
> how I would specify whether to use PUT or GET, etc.
>
> Has anyone done this themselves and have a quick answer?
>
> Cheers
>
> --
> --------------------------------------------------
> Dr Grahame S Cooper
> Director
> Information Technology Institute
> University of Salford
> Salford, M5 4WT, ENGLAND
>
> (Remove the anti spam field to EMail me.)
> ==================================================





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

Date: 14 Mar 98 01:08:46 GMT
From: "TomH" <beans@bedford.net>
Subject: Re: Reference to a part of a hash?
Message-Id: <01bd4ea3$5e411040$479163ce@beans.bedford.net>

######  It this what you meant by "entity"? 

%hash = ('asdf' => 'qwerty');

$ref = ${hash{asdf}};

print $ref;

 ...
> I am wanting to create a reference to an entity in a hash...  For
> instance...
> 
> %hash = ('asdf' => 'qwerty');
> 
> $ref = \{$hash{asdf}};
> 
> However, this doesn't work.  Any idea how to do this?
 ...


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

Date: Sat, 14 Mar 1998 03:46:11 GMT
From: doswald@xmission.com (David Oswald)
Subject: Re: Trimming a Variable
Message-Id: <3509faa7.63712102@news.xmission.com>

On Fri, 13 Mar 1998 07:49:37 -0600, payne.jim@hq.navy.mil wrote:

>I want to only get 3 characters of a variable. Can anybody tell me how I can
>do this.
>Thank you

$variable = "ABCDEFG";

$variable =~ m/^.../;
print $&;


(The output will be ABC)

$& contains the match.

This expression presents two problems though. First, strings shorter
than three characters will never match.  How about this?

$variable =~ m/^.{1,3}/;

This will match any string that has one or more characters, and will
match up to the first three such characters.

The second problem is that . will not match a \n.  So, a string
starting with \n will never match.  Also, a string that looks like
this, "A\nB" will only match the A though you may wish it to match the
entire A\nB.

You didn't explain the possible contents of $variable, but I suspect
the second problem won't really be of any interest to you.


Good luck,

Dave


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

Date: 14 Mar 1998 01:40:50 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: User-interface Quandary
Message-Id: <6ecn72$mol$2@client2.news.psi.net>

Tom Christiansen (tchrist@mox.perl.com) wrote on 1655 September 1993 in
<URL: news:6ebsam$lfv$1@csnews.cs.colorado.edu>:
++ 
++ In short, they compile into this, searching for "Fred"
++ 
++     Anywhere		    /Fred/
++     Whole Words Only 	    /\bFred\b/
++     Entire Field	    /^Fred$/

Perhaps:

       Search For String    /Fred/
       Search For Word      /\bFred\b/
       Go To                /^Fred$/


Hmmm.

String might not ring a bell with certain people. :(


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Fri, 13 Mar 1998 20:00:31 -0600
From: shaker@netusa1.net
Subject: Re: User-interface Quandary
Message-Id: <6eco9d$lfa$1@nnrp1.dejanews.com>

< snip >

> > I provide three choices:
> >
> >     Anywhere
> >     Whole Words Only
> >     Entire Field
> >
>

Two separate 'things' are at work here:

 (1) What is being matched - a sequence of letters in the first case,
      one or more words in the second case, a phrase in the third case

 (2) A condition regarding the rest of the item - no condition in the first
two  cases, an exclusivity condition in the third case

One can of course have the user specify these separately. For instance,

Search for                                              As
----------------                                              -----

Sequence of                          Should be the Only Item
Characters
                                              There May Be Other Items
Sequence of Words

Phrase

For the original three cases:

Anywhere  Sequence of  and  There May Be Other Items  Characters

Whole Words        Sequence of Words    and   There May Be Other Items
Only

 Entire Field  Phrase  and  Should be the Only Item


V. Chandrasekhar

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


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

Date: Sat, 14 Mar 1998 03:36:44 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: User-interface Quandary
Message-Id: <3509FA04.BCA1021F@usa.net>

I am sorry, I missed part of this discussion,
so if my response seems weireded out,
please ignore me :)

I feel that this is one of fuzzy logic
vs what people expect, and my
vote for /~Fred$/ is 'pattern match.'

I asked an 'english' prof friend of mine
and she seems to think that you would want
to use a new word which would discribe in
laymans term what a soundex does.

HTH,
Sneex :)

PS - Nice site!



Tom Christiansen wrote:

>  how to talk about a complete/exact/entire/everything
> match, like fgrep -x.
>
> Imagine this phrase:
>
>     "My name is Fred"
>
> I provide three choices:
>
>     Anywhere
>     Whole Words Only
>     Entire Field
>
> In short, they compile into this, searching for "Fred"
>
>     Anywhere                /Fred/
>     Whole Words Only        /\bFred\b/
>     Entire Field            /^Fred$/



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

Date: Sat, 14 Mar 1998 03:29:42 GMT
From: doswald@xmission.com (David Oswald)
Subject: Re: Using regex to initial cap a name
Message-Id: <3509ec7b.60083533@news.xmission.com>

On Mon, 09 Mar 1998 19:48:37 -0800, Franco Finstad <ffinstad@best.com>
wrote:

>I need to translate the string:
>
>    lastname, firstname
>
>into:
>
>    Lastname, Firstname
>
>I know this can be done elegantly using tr///; and s///; but I haven't
>found a way.
>
>Any ideas????

Hmm... let me try! ;)


How about this?

$string =~ s/(\b)(\w+)/$1\u\L$2/g;

Here is my logic.  I hope it's not flawed......

Use the substitution operator, s///

Match a word.  Be sure that the word begins with a word boundry,
capture the boundry, then capture the word.  Capture using
parenthesis.  Don't worry about a following boundry; it will be
ignored, or matched along with the next word match.  The reason that
we capture the boundry is so that it can be separated away from the
rest of the word.  This is necessary when using the \u expression
because \u only uppercases the first character of the expression.

Convert the entire match to all lower case.  I do this because I don't
want all caps in the case of someone entering his name like this:
JOHN DOE.  Then convert the first letter of the match to upper case.
Use /g so that both first name, last name, and possibly multi-word
last names (Mc Mahon, or Van Den Berghe) get converted properly.

You should get the following translations:

Oswald, David 	=	Oswald, David	-	My name.
oswald, david	=	Oswald, David
david oswald	=	David Oswald
oswald, david j.	=	Oswald, David J.
mc mahon, ed	=	Mc Mahon, Ed
McMahon, Ed	=	Mcmahon, Ed	-  This may be a problem!
van den berghe, john	=	Van Den Berghe, John



Note: I don't deal with the comma.  I see no need to get involved in
that, and you're on your own regarding checks to make sure that the
name was entered lastname first.

If I'm committing some terrible error don't be too upset; I've never
posted an untested regex to this group before for public scrutiny.

I see one potential problem with this method:

McMahon (no space between Mc and Mahon) will become Mcmahon.



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

Date: Sat, 14 Mar 1998 02:19:52 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Web based File manipulation on NT?? Help?
Message-Id: <3509E800.52062806@usa.net>

Not in group topic, try a CGI-related group;
However, Research File:: modules, but you didn't say which type/version
of perl
you're using.  When it comes to Web interaction the primary concern is
one
of file ownership and premissions.

HTH,
Sneex :)

Mark Polakow wrote:

>  I am not a programmer but have had success manipulating some scripts
> to work on NT with IIS4 -I want to be able to do file exchange
> functions through the web on NT IIS4. I have got a file upload module
> working smoothly but I want to be able to delete files and directories
> as well. None of the scripts Ive see so far can do this on NT. Can
> someone point me in the right direction??  Thanks very much in
> advance.





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

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

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