[7411] in Perl-Users-Digest
Perl-Users Digest, Issue: 1036 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 17 02:08:09 1997
Date: Tue, 16 Sep 97 23:00:21 -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, 16 Sep 1997 Volume: 8 Number: 1036
Today's topics:
Re: Chicago User Group (Clay Irving)
Re: Date & Time handling library wanted (Clay Irving)
Re: Deleting temp files with perl <petri.backstrom@icl.fi>
File Dates & Sizes noneya@internet.com
GDBM tie works from cmdline but not WWW?? <neal@valinet.com>
Re: Guestbook <chatmaster@spamwillbouncenstate.net>
Re: Guestbook <chatmaster@spamwillbouncenstate.net>
Hacking the Buddha, #10 <michal@efn.org>
How to append CGI parms to a file (newbie) <Jason.Hogg@worldnet.att.net>
Just getting started, need guidance (John)
Re: multiple interpreter locations? (Bob)
Re: PERL 5 for Alpha OpenVMS (Eric Harley)
Perl Conference notes by Gunther (Java frontend - perl (Krishnan Shankar)
problem with regular expressions <SUPERVISOR@msmlab.byu.edu>
Re: problem with regular expressions (Andrew M. Langmead)
Re: Streaming chat mode with Perl running on Win32s. An <chatmaster@spamwillbouncenstate.net>
Re: Tar question <Alan_Poindexter@bmc.com>
Re: Win 95 Perl & Tk <pvhp@forte.com>
Win32 Perl FAQ Addition? (WAS Re: Is Perl for Win32 rea (Jeremy D. Zawodny)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Sep 1997 22:00:46 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Chicago User Group
Message-Id: <5vndke$a55@panix.com>
In <341ecfc1.337239@news.wwa.com> faust@wwa.com (Faust Gertz) writes:
>On Mon, 15 Sep 1997 20:13:51 -0400, Mus <mus24@erols.com> wrote:
>>Is there a Chicago Perl User Group, if so please email me thanks!
>And before we have a string of "me too" posts, please post that
>information to the group too. :-)
If there are any PUGs (Perl User Groups), let me know and I'll link them
to the "User Groups" section in Perl Reference <http://reference.perl.com>.
Thanks!
--
Clay Irving <clay@panix.com> http://www.panix.com/~clay/
------------------------------
Date: 16 Sep 1997 21:56:06 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Date & Time handling library wanted
Message-Id: <5vndbm$9i7@panix.com>
In <341EA916.2EBE7ECC@access.ch> Thomas Arnold <tarnold@access.ch> writes:
>I'm a Perl 5 novice programmer and right now I'm writing a bunch of
>CGI scripts for Forms handling. I have trouble finding a good library
>or routine for manipulating and checking dates. Simple functions such
>as checking whether a user-entered date is valid, add or subtract a
>certain number of days/weeks/months/years to or from a date, the
>difference between two dates, etc. seem to be missing from the
>standard Perl library. The few libraries I found in Perl Archives
>(date.pl, time.pl, etc.) don't cover those basic date handling
>functions. Does anybody know where to get a Perl library or routine?
I can't imagine that Date::DateCalc or Date::Manip wouldn't handle your
requirements. Try:
http://reference.perl.com/module.cgi?Date::DateCalc
http://reference.perl.com/module.cgi?Date::Manip
--
Clay Irving <clay@panix.com> http://www.panix.com/~clay/
------------------------------
Date: Sat, 13 Sep 1997 12:11:49 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Deleting temp files with perl
Message-Id: <341A58D5.2F46@icl.fi>
Matt Weber wrote:
>
> What commands do I use in a perl script to delete a temporary file?
The same one you'd use to delete any file (Perl doesn't
care if it is temporary or permanent from your or the
operating system's point of view).
If you search for "delete" in the free on-line Perl
documentation, I'm sure that you will quickly stumble
upon unlink().
See also the Frequently Asked Questions (FAQ), which
you can locate through http://www.perl.com
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Wed, 17 Sep 1997 03:50:50 GMT
From: noneya@internet.com
Subject: File Dates & Sizes
Message-Id: <341f5315.11438954@news.chickasaw.com>
I am trying to print the file dates, file sizes and last
modification date into an html file from a perl routine that is doing
a foreach loop which opens a listing of files. I have tried
stat($filename) in the loop but I can't get any output to the html
file.
Can someone tell me am I calling stat wrong or am I just totally wrong
trying to use stat and is there some other way?
Thanks
------------------------------
Date: Tue, 16 Sep 1997 21:53:34 -0400
From: Neal Kaiser <neal@valinet.com>
Subject: GDBM tie works from cmdline but not WWW??
Message-Id: <341F381E.3B2D9D65@valinet.com>
Any ideas:
I have a gdbm file called "gdbm.db" which is chmod'd 755 (readable by
anyone).
I have a simple script with the following
tie(%DB,GDBM_File,"gdbm.db",GDBM_READER,0700);
..works great via cmd line.
Doesn't work via the web. Since I can't access my webserver error log, I
changed to the following:
tie(%DB,GDBM_File,"gdbm.db",GDBM_READER,0700) || print "ERROR: $!"
The error that gets printed out via the web is "INVALID ARGUMENT".
ANy ideas what this could be? I do not think it is a permissions
problem.
Thanks. Neal
------------------------------
Date: Tue, 16 Sep 1997 19:41:58 -0700
From: Chat Central <chatmaster@spamwillbouncenstate.net>
To: eric@wicksend.com
Subject: Re: Guestbook
Message-Id: <341F4376.4104@spamwillbouncenstate.net>
[Posted and Mailed]
There are.. You can code it to do so. But if you're looking for on that
arelady does this, then try Matt's Scripts. Sorry, I don't know the URL.
But I believe he has one that will do so, it's free. I don't know what
platforms it's made for,. but there's many perl scripts there.
Goodluck...
~Tim...
((Remove "spamwillbounce" from email address to reply))
eric@wicksend.com wrote:
>
> I am presently using a guestbook program that was modified with webstar
> for the mac and is an exe. Does anyone know of a guestbook script written
> in perl that has the ability to take input from a form and write output to
> MORE THAN ONE existing html file. This output needs to be inserted into a
> specific place within the existing html files...Thanks for any info..>ERic
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
--
Chat Central
In the top 5 most accessed sites on WebCrawler
since the first week up, and holding strong!!!
Receiving up to and over 10,000 visitors a day worldwide
Administrator - Chat Hub / Chat Central:
http://www.chathub.com - OR - http://chat.nstate.net
E-Mail Contact:
chatmaster@chathub.com, webmaster@chathub.com, sales@chathub.com,
info@chathub.com, admin@chathub.com, chatmaster@nstate.net
Webmaster Northstate Net:
http://www.nstate.net
E-Mail Contact:
webmaster@nstate.net
------------------------------
Date: Tue, 16 Sep 1997 20:02:40 -0700
From: Chat Central <chatmaster@spamwillbouncenstate.net>
To: eric@wicksend.com
Subject: Re: Guestbook
Message-Id: <341F4850.3A85@spamwillbouncenstate.net>
[Posted and Mailed]
There are.. You can code it to do so. But if you're looking for on that
already does this, then try Matt's Scripts.
Matt's Scripts Archive at: http://www.worldwidemart.com/scripts/
I believe he has one that will do so, it's free. I don't know what
platforms it's made for,. but there's many perl scripts there.
Goodluck...
~Tim...
((Remove "spamwillbounce" from email address to reply))
eric@wicksend.com wrote:
>
> I am presently using a guestbook program that was modified with webstar
> for the mac and is an exe. Does anyone know of a guestbook script written
> in perl that has the ability to take input from a form and write output to
> MORE THAN ONE existing html file. This output needs to be inserted into a
> specific place within the existing html files...Thanks for any info..>ERic
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
--
Chat Central
In the top 5 most accessed sites on WebCrawler
since the first week up, and holding strong!!!
Receiving up to and over 10,000 visitors a day worldwide
Administrator - Chat Hub / Chat Central:
http://www.chathub.com - OR - http://chat.nstate.net
E-Mail Contact:
chatmaster@chathub.com, webmaster@chathub.com, sales@chathub.com,
info@chathub.com, admin@chathub.com, chatmaster@nstate.net
Webmaster Northstate Net:
http://www.nstate.net
E-Mail Contact:
webmaster@nstate.net
------------------------------
Date: Tue, 16 Sep 1997 22:37:41 -0700
From: Sabren <michal@efn.org>
Subject: Hacking the Buddha, #10
Message-Id: <Pine.SUN.3.95.970916223607.8330A-100000@garcia.efn.org>
0916.97 Hacking The Buddha #10
----------------------------------------------------------------------
INFOFLOW
----------------------------------------------------------------------
HTB Lab Notes and Vital Stats
Hello again, everyone. :) Welcome back. This issue has been brewing in
the back of my mind for quite some time, and I think it's finally time
to pour it out, pass it around, and see how we might all enjoy
ourselves for the next hundred and something lines.
You see, I'm a teacher by nature (and occasionally by profession). I'm
also a fanatic learner. I love the fun of diving into a pool of
knowledge, and splashing others on the shore, just to watch them jump.
I've begun to wonder how much of that playfulness has actually seeped
its way into HTB (and in fact, into other contexts of my life). I
realized that it's not enough to change my writing style or my
philosophies. I'd like to actually devote an issue to talking about
playfulness and the flow of knowledge. Consider it a squirt gun aimed
at an unsuspecting friend. :)
Besides ideas loosly designed to help manifest people's buddha
natures, one of the main quests of this column is a model for writing
a good column. I mean, how does a writer build an audience? What
styles of writing, what ideas, etc. work best memetically, meaning,
what makes people want to get their friends to read something? That's
something I'm interested in. It's something I'm learning, and in the
spirit of the internet, it's something I've decided to share. Thus,
from now on, I will be including HTB's vital statistics:
Subscriber Count: 80
Granted, that's only one statistic, and it doesn't take into account
all the people who read HTB on the newsgroups or on the web, but
perhaps it's a useful gauge of an overall trend. In any case, memetics
fans might find it interesting.
Anyway... <squirt!>
Fusion
Of all the ideas I've encountered in books and in discussions about
the mind, one of the oddest is called Trancendental Meditation. Oh, I
understand the concept well enough. You chunk your thought processes
down to a singe word, or mantra, and repeat it over and over. You
become very focused, and as you send your neurons the same signal over
and over again, they simply accept it, and your awareness of the
mantra sinks below consciousness. You're totally blank. When you
finally notice the world again, even the most banal surroundings seem
bright and new. You feel relaxed and refreshed. I understand that.
What I don't understand is why so few people grok the inverse. There
is another way to step out of our normal consciousness, and it can
produce positive life- and world-changing results. I call this process
fusion.
Where TM creates a state of oneness by our letting go of all conscious
thoughts, fusion connects each and every thought like tinkertoys until
new thoughts cannot help but get pulled in.
Many people have described this state, and almost everyone has
experienced it. It is one of the most powerful learning states I can
imagine, and leads directly to flashes of what can only be called
enlightenment.
Enlightenment is not reserved for hermit gurus on remote mountaintops.
It is a process we all go through as we acquire new learnings.
Enlightenment literally means to bring light to something, and that
light is knowledge. Look at the expressions we use: "It dawned on me."
"A lightbulb went off in my head." "It came to me in a flash." All
submodalities aside, and before you go and make all your ideas big and
bright and connected to one another, let's take a look at how to get
there, and how to bring a friend.
States
I used to have a major discrepancy between the way I acted in person
and the way I acted while talking on the phone. In person, I was shy
and reserved, while on the phone I talked so much more. I used to have
a good friend who I hardly ever saw, but we talked all the time on the
phone, and the quality of those conversations were much higher than
that of the conversations I had in person with my other friends. When
I first began talking to Lori, she was in Atlanta and I lived in
Dallas, and we wound up building our relationship through long,
far-ranging conversations on the phone. When I moved up to Atlanta to
be with her and to study NLP, I somehow found myself losing touch with
that aspect of my personality.
One day while were at home, Lori asked me to call her from my phone
line in my room, and we started talking, and playing around. At one
point in the conversation, she walked into my room carrying her phone.
I stood there, looking at her, still talking into the phone, and I
realized that it had been a long time since we'd had a face to face
conversation that was this good. All of my experience in one state
(talking on the phone) suddenly leapt into another (talking face to
face).
In NLP terms, I had one state anchored to talking on the phone, and
one state anchored to talking face to face. When Lori walked in, the
anchors collapsed.
Thinking and learning are all about states. Remember that in NLP, a
state is defined as the sum of a person's physiology (posture,
breathing, etc) and her focus (real or imagined sights, sounds, and
feelings in the person's awareness). There are certain states, or
sequences of states, that work well for anything humans are capable of
duing, whether it's riding a bicycle, solving an equation, or carrying
on a conversation. There are other states that don't. (For example,
the state many great mathematicians or programmers go into when they
are working on an idea is not a very useful state to use when they're
talking to someone they love - in that work state, the loved one might
get totally ignored!)
Whenever I've worked with a student, whether I was teaching a kid to
read better, or explaining an idea to a friend of mine, I take the
time to notice what states they had been using to think about the
subject. That is, how had they aligned the pictures and sounds in
their mind, and how did those pictures and sounds correlate with the
data they were getting from the outside world. And how were they using
their feelings, their body, etc? All of this is simply a matter of
paying attention to the person when they talk about the subject
(calibration), and filling in the pieces with a few well-paced
questions.
From there, it's just a matter of building a better state, or sequence
of states for them to use, anchoring it, and collapsing it with where
they had been, so that the student can easily access the new
understanding.
Probably the most famous example of this is the simple spelling
strategy (which, I like to point out, also works great for phone
numbers). Good spellers have a two part strategy - first, they make a
picture of a word, and then they get a feeling about whether or not
it's spelled right. The process can be taught in a few minutes.
Now, that one's easy. It's sort of the "hello, world" of
neurolinguistic programming. Other applications, while made up of
similarly simple steps and states, allow us to do all the amazing
things people do, and to cook up new things to do when we're ready for
a change. It happens all the time because our brains our
self-programming, but we can consciously take control of this process,
and that's where the fun sets in.
Perl
This weekend, I finally bought the camel book. It's actual title is
Programming Perl by Larry Wall, Tom Christiansen, and Randal L.
Schwartz. People call it the camel book, because there's an engraving
of a camel on the front (there's also a llama book that supplements
it).
The attitude behind Perl is a lot like the attitude behind NLP. Larry
Wall (who also invented the Perl language) apparently has quite an
interest in linguistics, and Perl is designed to act much like a
natural language like English. That is, the syntax is similar, but
also, you don't have to know the whole language to use it. You can
write programs in perl "baby-talk" and still get your point across to
the machine. This ties in with one of the fundamental ideas in perl:
there's more than one way to do it. What really fascinated me about
the camel book was a reference to Wall's three great virtues of
programming: laziness, impatience, and hubris.
Laziness actually leads a good programmer to work efficiently and plan
ahead. That is, they make sure that they check their work and document
their code, and keep their programs useful. All of this saves them
lots of energy in the future. Impatience is anger aimed at lazy
computers. It leads programmers to create programs that that can
anticipate the user's need in the future, to create and reuse software
tools. Finally, hubris, or excessive pride, leads great programmers to
write programs that impress others. It keeps quality up.
These are the virtues of a great programmer, whether you are
programming a machine, or a human brain. Since NLP is teaching done
right, the virtues apply to teaching. Lazy NLP'ers will save energy by
callibrating their client's responses to stay on task. They'll future
pace and take care of ecology and they'll aim for generative change.
All of these things make their lifes easier, whether the context is
therapy, teaching, or even sales.
Impatient NLP'ers will apply every pattern, every learning, so that
each experienc builds their skills up. They'll quickly help their
clients connect with their internal resources so that they can begin
to create their own changes, and even quicker.
Finally, hubris definitely drives the great NLP'ers and teachers I
have known. They create for themselves a powerful, larger than life
state so that clients respect them enough to listen and to act on
their teachings. The great teachers set the highest standards for
their students, and do everything in their power to help their
students reach them. That is how they earn the title "great".
Infoflow
I have another book, which is about electronics. It tells me how I can
create a battery with a lemon and two metal rods. In fact, there are
several experiments that show how electricity can be manipulated or
generated with only a few common materials. The book is actually aimed
at adolescents, and it goes on to explain all sorts of concepts needed
to build electronic circuits. A teenager with very little mathematical
skill can now put together complicated circuits. Yet a hundred and
something years ago, the brightest minds in the country were working
like crazy just to generate and harness electricity.
How can something that seems so simple now have been so hard back
then? Didn't they have lemons?
The answer is simply that we know more. People in the past created
ideas and discovered new things about the world, and that knowledge
builds. Through hundreds and thousands of individual people's effort,
the human race as a whole is getting smarter and smarter and smarter.
The culture, the worldmind if you will, learns. Further, it learns by
the exact same process we do: by fusing ideas together.
For example, take the idea of memetics. Richard Dawkins, a biologist,
created the word "meme" when he took what he knew about genetics and
applied it to ideas. From a programming perspective, he reused some
mental code for one project that he had already used for another.
Laziness and Impatience!
A meme, in memetics compares to a gene in genetics. Thus, a meme is a
small idea that binds together to create other ideas. (It also tries
to replicate itself). So from a memetic perspective, when Dawkins
created memetics, some memes from the world of genetics used his brain
to replicate themselves into the world of ideas! Two ideas met, a new
idea was born, and that idea spread into an entire new field.
Einstein came along after electricity was discovered. He took the
ideas of Field Theory, which models the electromagnetic force, and
used them as a tool to explore his daydreams about the nature of
light. His equations allow us to understand exactly how radio and
electronics actually work.
So if ideas combine to create new ideas, how can we combine all of
these ideas into a model for effective teaching?
The Connection Machine
Brains work on their own. Sometimes, they act like a computer, doing
the same thing over and over without noticing. A good programmer can
change the code, press some buttons, and suddenly that brain starts
acting like a brain again - learning, communicating, having fun.
I've become a fan of big chunk learning. That means that when I teach
(either myself or someone else), I like to go for the big picture
first. What are good ways to think about a subject, even before I know
anything about it? How is it like other things I already understand? I
build a foundation.
Now, how is this foundation different from what I'm trying to learn?
What more do I need to know to be able to do what it is I want to do?
Let's take perl, for example. I wanted to refine a program I had
already written. The program takes a bunch of text files with HTML
codes in them (in this case the raw text files for Hacking the Buddha)
and formats them to look like an HTML template. This means that many
similar-looking web pages can be changed instantly by updating one
template and running the program.
In this case, I knew in my mind step by step what the computer would
have to do. I had already taught myself a little perl in writing the
original code, but this version was a lot more advanced, and I simply
didn't know the words that would tell perl what to do. I didn't have
to read an entire book to write my program. I didn't have to master
the language. I simply found what worked, and looked up anything that
didn't. Laziness and impatience again, yet it allowed me to create a
very useful tool in a short amount of time!
By creating a vague model of where you want to lead someone, and
comparing it with where they are, you not only save yourself so much
time, but you can keep a student interested.
If there's a state A and a state B, the shortest distance between them
is a logical progression of states, where each is a little more like B
and a little less like A. (Think of it as a line in multidimensional
hilbert space, where each dimension is a variable that contributes to
a state. Don't worry if you don't understand that. Instead, go get a
book on linear algebra, try on these ideas about learning, and figure
it out for yourself!)
If you want to teach somebody something, lead them through the states.
Conclusion
I'm beginning to understand now why Carmine, the NLP trainer I've
studied under, rarely spells things out step by step. It goes in one
ear and out the other. But by telling stories and eliciting certain
states, teachers convery their messages so much better. Sometimes they
don't even know they're doing it.
I admit it, I'm learning what I'm teaching here, and I'm using what
I'm learning in order to teach it. All I can say is that it feels
better this way. The ideas seem so much more alive. Everything does
connect to everything else, and the world does look bright and new.
Think about that. Peace.
... [[SaBReN]]
Pass it on!
Thanks for reading! If you enjoyed Hacking the Buddha, please consider
forwarding it to a friend.
----------------------------------------------------------------------
HACKING THE BUDDHA is published whenever the urge hits and
distributed via email and the world wide web.
To subscribe, send email with the subject "subscribe" to:
buddha-list-request@manifestation.com
To unsubscribe, send email to that address with the
subject "unsubscribe".
Back issues plus related links and writings are available
on the web at:
http://manifestation.com
----------------------------------------------------------------------
All Contents (c)1997 Manifest Station. This document may be freely
distributed so long as it remains unmodified and unabridged.
------------------------------
Date: 17 Sep 1997 02:17:38 GMT
From: "Jason Hogg" <Jason.Hogg@worldnet.att.net>
Subject: How to append CGI parms to a file (newbie)
Message-Id: <5vnek2$cli@bgtnsc02.worldnet.att.net>
Hello,
I am new to Perl, and wondered if any one could please point me to some
sample Perl code that simply copies all the parameters from an HTML form
(using the POST method) to the end of a flat file located on a Unix server.
I am simply trying to create a log file to store questionnaire answers in.
I would greatly appreciate any help.
Cheers
Jason
------------------------------
Date: Tue, 16 Sep 1997 22:45:30 GMT
From: jdesposito@exit109.com (John)
Subject: Just getting started, need guidance
Message-Id: <9107cd$153924.87@POSEIDON>
I am about to attempt to learn PERL and was looking for some guidance.
Can anyone share information in the following areas:
documentation
code/compilers
examples
etc.
Thanks is advance
John
------------------------------
Date: Wed, 17 Sep 1997 03:45:55 GMT
From: xxbbell@css.tayloru.edu (Bob)
Subject: Re: multiple interpreter locations?
Message-Id: <34215227.166422546@news.netusa1.net>
jg@physics.dcu.ie wrote:
>I have a perl script that is in a shared file system. The
>different machines that have access to this script have
>perl in different locations. Is there a way that I can put
>a list of locations to look for the perl interpreter instead
>of simply #!/usr/bin/perl etc?
I've been in similar situations and haven't found a way. See
if you can get you SysAdmin to create symbolic links so that all the
locations of perl will appear consistent.
--
- Bob
http://www.css.tayloru.edu/~bbell
xxbbell@css.tayloru.edu
remove x's to reply
------------------------------
Date: Tue, 16 Sep 1997 19:24:34 -0800
From: eharley@pacbell.net (Eric Harley)
Subject: Re: PERL 5 for Alpha OpenVMS
Message-Id: <eharley-1609971924340001@ppp-207-214-149-2.snrf01.pacbell.net>
> Does anyone know where I can get a reliable port for this OS?
It compiles out of the box for me on an AlphaStation 1000
--
Eric Harley
---------------------------------------------------------------------
"Medicine will cure death and government will repeal taxes before Steve will fail." -Guy Kawasaki (Fall 1991)
------------------------------
Date: 17 Sep 1997 05:08:55 GMT
From: kris@doe746j (Krishnan Shankar)
Subject: Perl Conference notes by Gunther (Java frontend - perl cgi backend)
Message-Id: <5vnol7$hbf@tensapp.sbi.com>
Does anyone know where i can find notes/paper/details on Gunter's paper.
Thanks
kris
------------------------------
Date: Tue, 16 Sep 1997 21:14:58 -0600
From: MSM Lab Supervisor <SUPERVISOR@msmlab.byu.edu>
Subject: problem with regular expressions
Message-Id: <341F4B32.5447@msmlab.byu.edu>
Hi everyone. I'm working on a script that needs to read a file
containing lines such as:
Your ID = !!!ID!!!, your last name = !!!lname!!!
It must then replace !!!ID!!!, and !!!lname!!!, etc, with the proper
entry in an associative array. I have a statement like this:
$line =~ s/!!!(.*)!!!/$data{\1}/g;
where %data is the associative array. Whatever equates to (.*) in the
reg. exp. should then replace the \1, right? I.e. $data{"ID"},
$data{"lname"}...
But my real question is this: how can I make a regular expression less
greedy? What happens is that with the line above, Perl wants to equate
!!!(.*)!!! with
ID!!!, your last name = !!!lname
instead of with ID, as I would like. How can I make the evaluation of
the reg. exp. stop at the second !!! instead of the final one?
If you can help I'd appreciate it.
Mike Felix
mikefelix@byu.edu
------------------------------
Date: Wed, 17 Sep 1997 04:30:47 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: problem with regular expressions
Message-Id: <EGMxvB.JKM@world.std.com>
MSM Lab Supervisor <SUPERVISOR@msmlab.byu.edu> writes:
>$line =~ s/!!!(.*)!!!/$data{\1}/g;
(A quick, unsolicited word of advice: Check what the perlop man page
says about the the s/// operator. Especially using expression matched
by parenthesis on the replace side.)
>But my real question is this: how can I make a regular expression less
>greedy?
One solution would be to use the non-greedy qualifiers that were added
to perl in version 5.
$line =~ s/!!!(.*?)!!!/$data{$1}/g;
Another would be to depend on the fact that your keys are always
alphanumeric and your delimiters are not:
$line =~ s/!!!(\w+)!!!/$data{$1}/g;
--
Andrew Langmead
------------------------------
Date: Tue, 16 Sep 1997 19:38:32 -0700
From: Chat Central <chatmaster@spamwillbouncenstate.net>
To: icon@lambuth.edu
Subject: Re: Streaming chat mode with Perl running on Win32s. Any ideas?
Message-Id: <341F42A8.4DB0@spamwillbouncenstate.net>
[Posted and Mailed]
My idea, is to use Java if you can, or if you don't mind doing so. I
don't know why your script has to be compiled to run?.. None the less,
how do you mean "streaming"?. Are you wanting a continual connection? Or
just updates via refresh or server push? Sorry, I don't recall WBS's
setup.
~Tim...
((Remove "spamwillbounce" from address to reply))
Icon Riabitsev wrote:
>
> Hi!
> I have run into problems trying to figure out how to create a
> streaming
> chat mode with Perl (as on wbs chat). So far, the page won't show up
> until all code is compiled, and that's understandable. Is there any
> workaround to this problem? Or should I use something other than perl
> for
> that (sob-sob...)?
>
> A little explanation -- Streaming chat is the one where new posts are
> added to the page constantly, without reloading the page itself, as if
> that was just a slowly-downloading huge page (but it's not).
>
> If anybody has any ideas, please E-MAIL me (I'm not subscribed -- our
> school doesn't have a news server and I'm tired of switching from one
> open
> NNTP to another as they close on me).
>
> My e-mail is icon@lambuth.edu. Any input will be highly appreciated!
>
> Thanks a lot.
>
> Icon Riabitsev.
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
--
Chat Central
In the top 5 most accessed sites on WebCrawler
since the first week up, and holding strong!!!
Receiving up to and over 10,000 visitors a day worldwide
Administrator - Chat Hub / Chat Central:
http://www.chathub.com - OR - http://chat.nstate.net
E-Mail Contact:
chatmaster@chathub.com, webmaster@chathub.com, sales@chathub.com,
info@chathub.com, admin@chathub.com, chatmaster@nstate.net
Webmaster Northstate Net:
http://www.nstate.net
E-Mail Contact:
webmaster@nstate.net
------------------------------
Date: Tue, 16 Sep 1997 16:30:56 -0500
From: "A. Poindexter" <Alan_Poindexter@bmc.com>
To: Aaron <aaron@soltec.net>
Subject: Re: Tar question
Message-Id: <341EFA90.250C4359@bmc.com>
Aaron wrote:
>
I'll probably get into a lot of trouble answering a question that really
has nothing to do with perl, but, what can I say, I'm just a nice
person...
posted and emailed
> In the words of the immortal Fat Albert
>
> "Hey, Hey, Hey"
>
> anyway
>
> Here's my puzzle
>
> I'm trying to do an automate ftp
>
> I am using the Net::FTP bit
>
> what I want to do is tar up a directory and ftp it over
>
> my program does soemthing like this
>
> print `/usr/bin/tar -cf moves.tar /opt/content/*`;
>
> then it ftps the file to the specified directory (no problems with that)
>
> then when I go to untar it manually
>
> I cd into the directory where the tar file is
> and when I un tar it I get an opt directory and then a content directory
> and then the files I wanted.
>
> How should I be doing this?
try:
print `cd /opt/content; /usr/bin/tar -cf moves.tar *`;
I think this will do what you want
you might also try the v switch to tar (verbose)
print `cd /opt/content; /usr/bin/tar -cvf moves.tar *`;
------------------------------
Date: Tue, 16 Sep 1997 22:25:49 -0700
From: Peter Prymmer <pvhp@forte.com>
To: Ralph Hempel <rhempel@log.on.ca>
Subject: Re: Win 95 Perl & Tk
Message-Id: <341F69DD.6CA9@forte.com>
Ralph Hempel wrote:
>
> I got the latest PERL/TK up and running on my WIN95
> box too, and once again, congrats to the porters that
> makes this kind of thing possible!
>
> One question. I looked at using TCL in the first place
> because it can talk to WIN95 serial ports. This is
> confirmed by running the TCL interpreter. But dammit,
> I STILL can't get anything to come out the serial port
> under PERL.
>
> I have looked thru DEJA NEWS, I have tried all the
> system call variants, used the flush lib, everything.
>
> I have written serial IO code using Visual C++, but admit
> that I don't want to know too much about hooking PERL
> to a C Library. That's why I use PERL scripts in the first
> place, to do things quickly. :-)
>
> Just my 2 pennies worth, and I'll keep looking for the
> elusive serial solution. And if I find it, I'll post it!
>
> Cheers, Ralph
I think that there was quite a discussion of this very problem
in one of the text documents on CPAN - but is was cleverly hidden
down in the
$CPAN/ports/msdos...
directory somewhere. I am sorry that I cannot be more specific
but I do recall a discussion of COM ports or somesuch. Look for
*.txt or *.doc files or somesuch - most of the *.zip files are
binary kits.
Good luck.
Peter Prymmer
------------------------------
Date: Wed, 17 Sep 1997 02:30:35 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Win32 Perl FAQ Addition? (WAS Re: Is Perl for Win32 really as brain damaged as it seems?)
Message-Id: <341f3fb0.517591937@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On Tue, 16 Sep 1997 15:22:35 -0700, Tom Phoenix
<rootbeer@teleport.com> wrote:
>On Tue, 16 Sep 1997, Russell Odom wrote:
>
>> Not necessarily: just run the registry editor (regedit.exe) and search for
>> all occurences of 'A:\'. Remove the ones that aren't absolutely necessary
>> (usually all of them).
>
>Since Perl can work directly with the registry, couldn't a simple script
>do this? I don't have a Windows machine or I'd try writing this script
>myself. But if anybody will write a good one, I'll do my best to get it
>enshrined in the FAQ.
A Perl script *could* search the registry for all references to A:\
(or B:\ for that matter) using some of the Win32::* modules. However,
the hard part would be making sure the Perl script only nukes the
unnecessary ones. :-)
Personally, I curious to know which bits of software have been leaving
A:\ refs in registries for no good reason. I've seen it on a few Win95
systems, but the 6+ NT systems I've used Perl on never seem to have
the problem.
Maybe I should raise this issue on the Perl-Win32-Users list and see
if we should add it to that FAQ... (I've cheated and cc'd them on this
message.)
Jeremy
---
Jeremy D. Zawodny
WCNet Technical Geek & Web Stuff
<URL:http://www.wcnet.org/~jzawodn/>
"These constraints effectively ruled out the obvious choices of using
plain fingers (yogurt is not a finger food at work), and of constructing
a make-shift spoon from paper clips, scraps of paper, and scotch tape."
-- Justin Dolske (dolske@cis.ohio-state.edu> in alt.hackers
------------------------------
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 1036
**************************************