[24727] in Perl-Users-Digest
Perl-Users Digest, Issue: 6882 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 19 11:06:00 2004
Date: Thu, 19 Aug 2004 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 19 Aug 2004 Volume: 10 Number: 6882
Today's topics:
capture scoping <jeff@spamalanadingong.com>
Re: capture scoping (Greg Bacon)
Re: capture scoping (Anno Siegel)
Re: capture scoping <gnari@simnet.is>
Re: Earthquake forecasting program Aug. 16, 2004 (Oriel36)
Re: Earthquake forecasting program Aug. 16, 2004 <edgrsprj@ix.netcom.com>
Re: Earthquake forecasting program Aug. 16, 2004 <edgrsprj@ix.netcom.com>
Re: Earthquake forecasting program Aug. 16, 2004 <edgrsprj@ix.netcom.com>
Re: Earthquake forecasting program Aug. 16, 2004 <jurgenex@hotmail.com>
Re: Earthquake forecasting program Aug. 16, 2004 <1usa@llenroc.ude.invalid>
Re: editing perl script through TEXTAREA <flavell@ph.gla.ac.uk>
Re: editing perl script through TEXTAREA <noreply@gunnar.cc>
Re: editing perl script through TEXTAREA <gnari@simnet.is>
Re: editing perl script through TEXTAREA <noreply@gunnar.cc>
File::Find question. (Steve P)
Re: File::Find question. <mritty@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Aug 2004 12:17:43 GMT
From: Jeff Thies <jeff@spamalanadingong.com>
Subject: capture scoping
Message-Id: <HT0Vc.27479$nx2.12134@newsread2.news.atl.earthlink.net>
I'm having some trouble understanding/controlling the scope of $1.
I have this:
$data=~s/<input .*?type="text" .*?value="(.*?)".*?>/$1/gs;
amongst other regexes.
This flies apart when the match is empty (ie: value=""), it then uses
the next match which is not empty even though that may in a different
<input ...>
How do I get the regex to sub in a "".
I printed out perldoc perlre a while ago and maybe this is in there, but
I can't find it!
Jeff
------------------------------
Date: Thu, 19 Aug 2004 13:06:09 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: capture scoping
Message-Id: <10i99e1afbccpe5@corp.supernews.com>
In article <HT0Vc.27479$nx2.12134@newsread2.news.atl.earthlink.net>,
Jeff Thies <jeff@spamalanadingong.com> wrote:
: $data=~s/<input .*?type="text" .*?value="(.*?)".*?>/$1/gs;
:
: This flies apart when the match is empty (ie: value=""), it then
: uses the next match which is not empty even though that may in a
: different <input ...>
:
: How do I get the regex to sub in a "".
Keep in mind that s/// replaces the *entire* substring that matches
the pattern on the lefthand side with the replacement that's on the
righthand side.
Are you trying to empty the value of the value attribute?
You can help us give you good advice by supplying a small, complete
example and an explanation why its output isn't what you expect.
Greg
--
Every election is a sort of advance auction sale of stolen goods.
-- H. L. Mencken
------------------------------
Date: 19 Aug 2004 13:26:04 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: capture scoping
Message-Id: <cg29pc$15u$1@mamenchi.zrz.TU-Berlin.DE>
Jeff Thies <jeff@spamalanadingong.com> wrote in comp.lang.perl.misc:
> I'm having some trouble understanding/controlling the scope of $1.
>
> I have this:
>
> $data=~s/<input .*?type="text" .*?value="(.*?)".*?>/$1/gs;
>
> amongst other regexes.
>
> This flies apart when the match is empty (ie: value=""), it then uses
> the next match which is not empty even though that may in a different
> <input ...>
>
> How do I get the regex to sub in a "".
"sub in"? Please don't invent non-standard abbreviations and leave us
guessing what they mean.
A substitution (not a regex) will happily substitute an empty string
if that is what matched. Depending on the input data you may be unable
to see it. Make the substitution side s/.../($1)/ so an empty string
shows up as an empty pair of (). If that still seems to use the
next match down the line, show your input data.
Anno
------------------------------
Date: Thu, 19 Aug 2004 13:14:03 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: capture scoping
Message-Id: <cg28uv$irc$1@news.simnet.is>
"Jeff Thies" <jeff@spamalanadingong.com> wrote in message
news:HT0Vc.27479$nx2.12134@newsread2.news.atl.earthlink.net...
> I'm having some trouble understanding/controlling the scope of $1.
>
> I have this:
>
> $data=~s/<input .*?type="text" .*?value="(.*?)".*?>/$1/gs;
>
> amongst other regexes.
>
> This flies apart when the match is empty (ie: value=""), it then uses
> the next match which is not empty even though that may in a different
> <input ...>
please show us a short but complete program that
exhibits these symptoms.
gnari
------------------------------
Date: 19 Aug 2004 03:57:11 -0700
From: geraldkelleher@hotmail.com (Oriel36)
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <273f8e06.0408190257.1e0c31ba@posting.google.com>
Bob Officer <bobofficers@invalid.net> wrote in message news:<vo18i01eiadc7a18avjsqog210puntbouk@4ax.com>...
> On 18 Aug 2004 08:25:12 -0700, in sci.geo.earthquakes,
> geraldkelleher@hotmail.com (Oriel36) wrote:
>
> >Bob Officer <bobofficers@invalid.net> wrote in message news:<1v86i0908fnd4b2jbj3sm1gl6q4ov0rr3r@4ax.com>...
> >> On Tue, 17 Aug 2004 06:55:50 GMT, in sci.geo.earthquakes, "edgrsprj"
> >> <edgrsprj@ix.netcom.com> wrote:
> >>
> >> >
> >> >"Jaxtraw" <jaxtraw@nospamnobigfoot.com> wrote in message
> >> >news:1092684544.19111.0@ersa.uk.clara.net...
> >> >> "edgrsprj" <edgrsprj@ix.netcom.com> wrote in message
> >> >> news:0f1Uc.23551$nx2.17009@newsread2.news.atl.earthlink.net...
> >> >> > August 16, 2004 Posted to sci.geo.earthquakes and other Newsgroups
>
> >> >>
> >> >> Intriguing, but it seems to me you should test also for false negatives.
> >> >> ...
> >> >
> >> >August 17, 2004
> >> >
> >> >Hi Ian, Thanks for the comments.
> >> >
> >> >At the moment this what might be described as "Any port in the storm
> >> >technology." That means that we have a desperate situation where
> >> >earthquakes are claiming lives without anything to stop that from happening.
> >> >More than 25,000 people reportedly perished last December in Iran from an
> >> >unexpected earthquake. And the immediate goal is to find anything at all
> >> >which can help.
> >> >
> >> >I know of at least two promising looking technologies which are being used
> >> >in China. But each of the detector units runs something like $10,000 U.S.
> >> >You need multiple units to cover a given area plus all of the support
> >> >personnel. And they still apparently miss an unacceptably high percentage
> >> >of the destructive earthquakes.
> >>
> >> That means the system doesn't work...
> >>
> >> >One of the reasons that my program looks so attractive at the moment is the
> >>
> >> Only to you... but then it isn't really your program. you didn't gather the
> >> data or write the computer program. You are a CRACKPOT.
> >
> >You do astrology for goodness sake !,you look for correlations in
>
> Yep as a entertainment/hobby, I learned astrology as a child. I also make
> mirrors for astronomical telescopes, as well as spend hours cutting gems
> with little tiny facets. I don't do astrology for profit and have often
> posted I don't believe in astrology. I only point out when and where I do
> cold reads 99% of astrologers use cold reads and vague wide statements. I
> point out Astrology is a scam. Does it bother you I can discuss astrology
> and with all but the truly fanatical help them see that astrology is just a
> silly superstition?
>
The basis for astrology and their symbols had relevance to the
Eygptians (or perhaps a civilisation before them) as time reckoning
or the helical risings where the night is broken into twelve divisions
forcing daylight into the same amount,hence the division of the day
into 24 equal parts.It is the basis for a 24 hour clock day,our
ancestors being wiser than we are then worked the day from noon to
noon as 24 hours and corrected the natural inequality by using the
Equation of Time correlation.
Flamsteed in his eagerness to solve the longitude problem linked
stellar circumpolar motion directly to axial rotation and destroyed
the exquisite correlation between the natural unequal day and the 24
hour clock day,Newton either did'nt know or did'nt pick up on the
error and created the empirical mess that destroyed astronomy and
turned astronomers into cataloguers.
"Absolute time, in astronomy, is distinguished from relative, by the
equation or correlation of the vulgar time. For the natural days are
truly unequal, though they are commonly considered as equal and used
for a measure of time; astronomers correct this inequality for their
more accurate deducing of the celestial motions. ......The necessity
of which equation, for determining the times of a phænomenon, is
evinced as well from the experiments of the pendulum clock, as by
eclipses of the satellites of Jupiter"
http://members.tripod.com/~gravitee/definitions.htm#time
Newton is taking through his hat,the pendulum experiments are
Flamsteed's time trials and the satellite eclipses are Roemer's use of
the Equation of Time.If you do not know what the Equation of Time
is,you would be in no position to judge why Newton is hairbrained.
> >planetary positions on human existence and that just takes a google
> >search on your posting history.The poster is in no way offensive,even
>
> Actually Google should have a very sparse history on me. 90% of every has
> been done using XNA basis.
>
> >if his data is like finding order in white noise,billions of public
> >funding is going to do the same thing.
>
> Yep, most of it will be white noise, I suspect. Since there is no one cause
> for quakes, no one prediction system will work.
>
Look,I will make it easy for you.This is how physicists and
astronomers see the cosmos,the illusion that creates the
constellations is due to the Earth's rotation and looks like this.
http://ottawa.rasc.ca/pictures/pdelorme/polaris.jpg
When galaxies were discovered in the 1920's they simply switched from
stars everywhere to galaxies everywhere and kept on talking about how
the universe looks the same in all directions.It should take a
astrologer about two minutes to realise that if the stars in the Milky
Way are rotating that it would also generate a galactic version of the
celestial sphere,an illusion generated by stellar rotation about the
Milky Way axis with the Polaris effect perpendicular to the galactic
axis.
http://wave.xray.mpe.mpg.de/rosat/publications/highlights/coma_cluster/coma_1.gif
So now what you have is a celestial sphere inside a celestial sphere
and everyone thinks this is the greatest thing ever.Kepler was an
astrologer but it did not stop him from sorting out illusions from
what is actual,contemporaries could'nt do that today to save their
lives.
> >http://zebu.uoregon.edu/~imamura/123/lecture-1/cmbr.html
> >
> >If a fraction of that money was turned to geology,departments would
> >not be closed down and more immediate terrestial concerns would take
> >priority much less appreceating the magnificence of the whole
> >thing.The inability of geologists to make the astronomical leap as a
> >natural progression of plate movement assures that
> >fundamentalism,astrology and barely concealed empirical silliness will
> >flourish.
>
> I would love to see more silly superstitions left by the side. If one
> fraction of the money given to churches was given to science... Humanities
> lot would improve much faster than all the missionaries in the world could
> have ever work.
>
I am a Christian who actually celebrates the belief,likes the idea
that once inside a church it is nobodies business to participate that
way nor outside to participate as I do now through investigation of
natural phenomena.Can work as easily with the genealogical structure
of the Genesis chronology as the Hebrew author intended (to stop the
narrative swamping the flesh and blood message behind the narrative)
as to accept how good the narrative is on its own terms .
Hermetic and gnostic traditions are pale imitations,all head and no
heart.Emiprical traditions as they have evolved are even a pale
imitation of those,anyone who reads Julius Oppert and not come away
with admiration from the Hebrew scribes is welcome to contend with the
creationists and other fundamentalist interpreters.
http://134.76.163.65/servlet/digbib?template=hitlist%2Ehtml&search-attribute1=Author&search-value1=Oppert%2C%20Julius
The late Joseph Campbell was an able interpreter even if the Genesis
chronology is far more exquisite than the broad outlines found in
Campbell's commentary,the linking of the Gen 1 with Gen 5,the use of
Enoch's lifespan as an exception allied with the calendrical
system,the fraction of days in Gen 7 that links the cycle of Adam's
creation to Noah's flood as a highly developed form of Gligamesh and
many more.
> >You produce the slogan of a crackpot on this man while guys receive
> >billions for having the Earth at the center of the universe,turn it
> >what way you will,that is what it amounts to when you decide an
> >alternative approach to the 'past'.
>
> Gerald. This man is a crank/crackpot. I have watched him and his actions as
> he has trolled from Group to group.
>
> <snip>
>
> >Hermetic principle is astrology's fundamental rule, and it fails in
> >every
> >testing.
> >
> >Bob Officer
>
> Gerald do you understand what the term "Hermetic Principle" means ...?
> followed by the word it (referring to hermetic principle) "fails every
> time"?
>
Hermetic principles,gnostic principles ect,I know them all,one no
better than the next in the scheme of things.I like the story of
Leibniz who wanted to join an alchemical sect so he just borrowed
phrases from different sourses without caring what they meant and was
allowed into the sect and made secretary to boot. The empirical
tradition and its disciples are no different,the original intentions
were fine but ultimately were bound to descend into the same oracle
reading or the ability to say so much while saying nothing using its
own peculiar language.
Mathematics is like Phaeton's chariot in the wrong hands,it will
scorch the Earth and the Sky unless it is hit with a
thunderbolt.Astrology is fine as long as a man capable of handling it
is under no illusions to its limits, creationism and empiricalism
likewise.There is almost an underground history of humanity that
threads its way through the rise and fall of different idealism,taking
the route of natural discovery and the inventiveness of man is
probably one of the richest despite the attempts to attribute
everything to the Greeks for the empirical conception of the onward
upward march of science.The pearls are beneath while the straws float
and so it remains.
> Note: The Hermetic Principle: as above, so below. Is what I was showing to
> be false in the above cited article. That doesn't really sound like I am a
> big supporter of astrology, does it?
>
> Second note: Gerald should also be aware I was one of the party of 18 or so
> people named in suit a few years ago by pete stapleton for telling people
> that his astrology didn't work every time, and pointing out how it did work
> at all.
>
> Sigh...
------------------------------
Date: Thu, 19 Aug 2004 12:56:28 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <0s1Vc.27517$nx2.16762@newsread2.news.atl.earthlink.net>
August 19, 2004
These discussions seem to often start with people talking about the subject
matter of the original post. Then the conversations wander off in other
directions. Eventually the thread comes to an end. Hopefully that will
happen to this one fairly soon.
------------------------------
Date: Thu, 19 Aug 2004 12:56:29 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <1s1Vc.27518$nx2.14630@newsread2.news.atl.earthlink.net>
"Bob Officer" <bobofficers@invalid.net> wrote in message
news:da18i05ioseql894qc8s6v71eri46bqqpo@4ax.com...
> On Wed, 18 Aug 2004 06:24:39 GMT, in sci.geo.earthquakes, "edgrsprj"
> <edgrsprj@ix.netcom.com> wrote:
>
> It isn't yours. it was however written for you. If spent better part of a
> year in comp groups begging for help. I doubt you have any idea how the
> program works or what it does.
>
August 19, 2004
I have no idea what this person is talking about. I myself have created and
am using four separate earthquake forecasting computer programs. The one
which I am presently making available to people is a Perl language program
one version of which I copyrighted earlier this year. It is pretty rough,
especially with its latest version. And no Perl programming expert that I
know of would ever take credit for writing it even if someone else had. The
other programs are written in other computer languages. To a large extent
these programs represent something like 15 other computer programs which
were developed over about 15 years and eventually merged into those four.
The Perl program is gradually having new subroutines added to it. The goal
is to eventually merge the functions of the other 3 programs into that one
program.
He is partly correct about one thing though. I really don't know why that
Perl program works. It is based on a geophysics theory picture which I
developed and which appears to be accurate as far as it goes. But no one
that I know of can explain exactly what it is telling us about the true
nature of earthquake triggering processes.
------------------------------
Date: Thu, 19 Aug 2004 13:18:15 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <rM1Vc.27541$nx2.26902@newsread2.news.atl.earthlink.net>
"Palmer Clancy" <cb8182004@hotmail.com> wrote in message
news:4c7a939.0408180527.145615f@posting.google.com...
> Obviously I'm not the only one here who thinks this thread is a sham -
> but glancing through the code the original poster provided I couldn't
> find what the catch was. Granted the code was unnecessarily long and
> difficult to read (goto???), but at a superficial glance nothing
> seemed untoward.
>
> So the question for the rest of you good people out there is - Is this
> thread a conniving attempt at trickery? or simply naivete to the
> extreme?
August 19, 2004
Most of the present Perl program represents rapid translations of perhaps a
dozen GW-BASIC programs which were combined into that one Perl program early
this year. That is one of the reasons that the Perl program has the form
that it has and why it looks so rough.
You can see some of the data which the latest version of the program is
producing on the following Web page:
http://www.freewebz.com/eq-forecasting/Data.html
Those data are there for the review of governments and disaster mitigation
personnel around the world. They are intended in part to let them know
where earthquake "hot spots" might be located, places where future
earthquakes could occur. They can then check those locations for possible
seismic activity. Detailed reports discussing how to interpret those data
were sent to governments, disaster mitigation groups, and something like 150
geophysics experts earlier this year. That Web page is presently scheduled
for a major format update.
The technology behind that program was discussed at two important disaster
mitigation conferences in China in the last 6 months or so. And the
existence of that Web page and the philosophy behind it was discussed in
several United Nations / ISDR reports earlier this year. In certain
quarters this effort is being taken quite seriously.
Rough as it might be, that Perl program produces some extraordinary data.
Once I got used to working with Perl I found that I could add new data
processing subroutines to the program quickly and easily. However I still
understand only a fraction of what Perl can do.
Regarding some of the other posts which might look foolish, just ignore
them. Those people will soon lose interest in the thread and it will end.
------------------------------
Date: Thu, 19 Aug 2004 13:56:34 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <mk2Vc.22945$Kf4.17059@nwrddc02.gnilink.net>
edgrsprj wrote:
> August 19, 2004
Is there a specific reason why you distrust your news reader to generate the
correct "Date" header?
You may not believe it but it but that header even includes the time!
> Most of the present Perl program represents rapid translations of
> perhaps a dozen GW-BASIC programs which were combined into that one
> Perl program early this year. That is one of the reasons that the
> Perl program has the form that it has and why it looks so rough.
Has this changed in any way since you posted your first chunk of crap half a
year ago?
> Regarding some of the other posts which might look foolish, just
> ignore them. Those people will soon lose interest in the thread and
> it will end.
This thread would not exist in first place if you wouldn't have come back
again.
jue
------------------------------
Date: 19 Aug 2004 15:00:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Earthquake forecasting program Aug. 16, 2004
Message-Id: <Xns954A700ED2E8Basu1cornelledu@132.236.56.8>
"edgrsprj" <edgrsprj@ix.netcom.com> wrote in
news:rM1Vc.27541$nx2.26902@newsread2.news.atl.earthlink.net:
> "Palmer Clancy" <cb8182004@hotmail.com> wrote in message
> news:4c7a939.0408180527.145615f@posting.google.com...
>> Obviously I'm not the only one here who thinks this thread is a sham
>> - but glancing through the code the original poster provided I
>> couldn't find what the catch was. Granted the code was unnecessarily
>> long and difficult to read (goto???), but at a superficial glance
>> nothing seemed untoward.
>>
>> So the question for the rest of you good people out there is - Is
>> this thread a conniving attempt at trickery? or simply naivete to
>> the extreme?
It is stupidity to the extreme.
> August 19, 2004
This is not a printed medium. I hope you realize that.
> Most of the present Perl program represents rapid translations of
> perhaps a dozen GW-BASIC programs which were combined into that one
> Perl program early this year. That is one of the reasons that the
> Perl program has the form that it has and why it looks so rough.
You have done nothing to improve the quality of the program. You have no
questions regarding Perl because you do not know enough to know what you
don't know and you do not listen to other people who do know.
Hmmm ... Just deleted about a 100 lines of rants that I had written in
response to you after noticing:
> Regarding some of the other posts which might look foolish, just
> ignore them. Those people will soon lose interest in the thread and
> it will end.
You have brought all those posts into this group by cross-posting an
article that has nothing to do with Perl. Please stop doing that. Go
away.
--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)
------------------------------
Date: Thu, 19 Aug 2004 11:37:44 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <Pine.LNX.4.61.0408191133190.4267@ppepc56.ph.gla.ac.uk>
On Thu, 19 Aug 2004, Gunnar Hjalmarsson wrote:
> Alan J. Flavell wrote:
> >
> > You know as well as I do that CGI.pm isn't telepathic: it gets fed
> > exactly the same data stream as any other CGI process would get
> > fed.
>
> Yep. My comment was triggered by other posts in this thread with the
> usual, awfully tiresome "CGI.pm takes care of it all" message.
This is unworthy of you. The fact that CGI.pm is subject to the same
interworking rules as every other CGI software should come as no
surprise, and by trying to use it as a weapon to beat down those who
recommend the use of CGI.pm, you're more likely to weaken your own
argument than to strengthen it. IMHO. Now let's put this sub-thread
aside, and get back to substantive matters.
all the best
------------------------------
Date: Thu, 19 Aug 2004 14:19:05 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <2ojkc0FbgiipU1@uni-berlin.de>
Alan J. Flavell wrote:
> Gunnar Hjalmarsson wrote:
>> My comment was triggered by other posts in this thread with the
>> usual, awfully tiresome "CGI.pm takes care of it all" message.
>
> This is unworthy of you. The fact that CGI.pm is subject to the
> same interworking rules as every other CGI software should come as
> no surprise, and by trying to use it as a weapon to beat down those
> who recommend the use of CGI.pm, you're more likely to weaken your
> own argument than to strengthen it. IMHO.
Please wake up, Alan!
Previously in this thread, Xho and gnari discussed a fictitious need
for a "reverse convertion" of HTML entities, and claimed that CGI.pm
addresses that non-issue. Is it "unworthy" to react to misinformation?
> Now let's put this sub-thread aside, and get back to substantive
> matters.
Yes, now.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 19 Aug 2004 13:08:48 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <cg28l5$iqm$1@news.simnet.is>
"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:2ojkc0FbgiipU1@uni-berlin.de...
> Alan J. Flavell wrote:
> > Gunnar Hjalmarsson wrote:
[snip familiar tirade about CGI.pm]
> Previously in this thread, Xho and gnari discussed a fictitious need
> for a "reverse convertion" of HTML entities, and claimed that CGI.pm
> addresses that non-issue. Is it "unworthy" to react to misinformation?
I admit having mixed up htmldecoding and urldecoding on the part
of param(), so there is no 'reverse' convertion as such, but the fact
remains that param() decodes the form data and textarea() encodes it.
what is the problem ?
I think you are much too sensitive on this topic. no one is doubting
your abilities to write decent replacements for these functionalities,
but it is simpler and safer to tell a relative newbie to use CGI.pm
now, I would rather return to the previous and more interesting
subject of the problem with non-ASCII characters in form submissions.
what strategies are used to deal with this problem ?
gnari
------------------------------
Date: Thu, 19 Aug 2004 16:59:49 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <2ojtq2Fbd6qvU1@uni-berlin.de>
gnari wrote:
> Gunnar Hjalmarsson wrote:
>> Previously in this thread, Xho and gnari discussed a fictitious
>> need for a "reverse convertion" of HTML entities, and claimed
>> that CGI.pm addresses that non-issue. Is it "unworthy" to react
>> to misinformation?
>
> I admit having mixed up htmldecoding and urldecoding on the part of
> param(), so there is no 'reverse' convertion as such, but the fact
> remains that param() decodes the form data and textarea() encodes
> it. what is the problem ?
The OP had misunderstood what's happening when you submit a form with
a textarea control, and needed a clarification. Instead she was
incorrectly advised that using CGI.pm's param() would take care of 'it'.
> I think you are much too sensitive on this topic. no one is
> doubting your abilities to write decent replacements for these
> functionalities,
The fact that a bunch of regulars here have done just that might
explain your perception of me being too sensitive. ;-)
But my objection this time stands for itself. It's important that
people who use CGI scripts gain a basic understanding and insight
about what's happening, about the implied security risks and the need
to validate data, etc. Repeatedly hearing regulars here attribute
things to CGI.pm, that the module was never designed to handle,
counteracts that 'mission'.
> it is simpler and safer to tell a relative newbie to use CGI.pm
Absolutely. Therefore I used it in the script I posted in this thread.
But it can cause confusion, as in this case, if you give that advice
for the wrong reason.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 19 Aug 2004 06:31:11 -0700
From: nomad3d@msn.com (Steve P)
Subject: File::Find question.
Message-Id: <af2809b.0408190531.5e5935e1@posting.google.com>
Hello. I have this script below, and I need to only return the file
names rather than the whole path and filename and I'm a little fuzzy
on how to accomplish this. I've used find2perl to generate part of the
code. I need to read the directory, which is a sym link to a samba
mounted share, and get only the file names, which can and do vary as
well as the directory structure.
__________________________________________________________________________
#! /usr/bin/perl -w
use diagnostics;
use strict;
use File::Find ();
use Cwd;
open(OUT, ">/opt/lampp/htdocs/rfu/rfu.htm") or die "Can't open file:
$!\n";
&print_html();
&processfiles;
&printtail();
&redirect();
sub print_html {
my $curr = cwd ();
print OUT "<HTML>\n<HEAD>\n";
print OUT "<TITLE>File Listing</TITLE>\n";
print OUT "</HEAD>\n<BODY>\n";
print OUT "<P>\n";
}
sub processfiles {
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
*prune = *File::Find::prune;
File::Find::find( {wanted => \&wanted, follow => 1},
'/opt/lampp/htdocs/rfu/');
sub wanted {
/^.*\.rfu\z/s &&
print OUT ("$name\n<BR>");
}
}
sub printtail {
print OUT "</BODY></HTML>\n";
close OUT;
}
sub redirect {
print 'Location: http://www.someplace.com/rfu/rfu.htm',
"$ENV{QUERY_STRING}\n\n";
}
_________________________________________________________________
Thanks in advance
Steve Powell
------------------------------
Date: Thu, 19 Aug 2004 09:39:45 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: File::Find question.
Message-Id: <20040819093700.T2996@barbara.cs.rpi.edu>
On Thu, 19 Aug 2004, Steve P wrote:
> Hello. I have this script below, and I need to only return the file
> names rather than the whole path and filename and I'm a little fuzzy
> on how to accomplish this. I've used find2perl to generate part of the
> code. I need to read the directory, which is a sym link to a samba
> mounted share, and get only the file names, which can and do vary as
> well as the directory structure.
Did you try reading the docs for File::Find?
For example, when examining the file /some/path/foo.ext you
will have:
$File::Find::dir = /some/path/
$_ = foo.ext
$File::Find::name = /some/path/foo.ext
Just use $_ instead of $File::Find::name inside the wanted function.
(find2perl is doing the odd bit of making just $name represent
$File::Find::name - just replace $name with $_)
Paul Lalli
> __________________________________________________________________________
>
> #! /usr/bin/perl -w
>
> use diagnostics;
> use strict;
> use File::Find ();
> use Cwd;
>
>
> open(OUT, ">/opt/lampp/htdocs/rfu/rfu.htm") or die "Can't open file:
> $!\n";
> &print_html();
> &processfiles;
> &printtail();
> &redirect();
>
>
> sub print_html {
> my $curr = cwd ();
> print OUT "<HTML>\n<HEAD>\n";
> print OUT "<TITLE>File Listing</TITLE>\n";
> print OUT "</HEAD>\n<BODY>\n";
> print OUT "<P>\n";
> }
>
> sub processfiles {
> use vars qw/*name *dir *prune/;
> *name = *File::Find::name;
> *dir = *File::Find::dir;
> *prune = *File::Find::prune;
>
> File::Find::find( {wanted => \&wanted, follow => 1},
> '/opt/lampp/htdocs/rfu/');
>
> sub wanted {
> /^.*\.rfu\z/s &&
>
> print OUT ("$name\n<BR>");
> }
> }
>
> sub printtail {
> print OUT "</BODY></HTML>\n";
> close OUT;
> }
>
> sub redirect {
> print 'Location: http://www.someplace.com/rfu/rfu.htm',
> "$ENV{QUERY_STRING}\n\n";
> }
> _________________________________________________________________
>
> Thanks in advance
> Steve Powell
>
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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.
#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 V10 Issue 6882
***************************************