[10199] in Perl-Users-Digest
Perl-Users Digest, Issue: 3792 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 22 23:09:23 1998
Date: Tue, 22 Sep 98 20:00:15 -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, 22 Sep 1998 Volume: 8 Number: 3792
Today's topics:
Re: any way to encrypt my script? bitnut1@my-dejanews.com
Re: any way to encrypt my script? (Ronald J Kimball)
Re: Change chars in STDOUT? <rick.delaney@shaw.wave.ca>
Re: Change chars in STDOUT? (Ronald J Kimball)
Re: changing $ 'variables' in regexprs (John Moreno)
Re: Cookie Help! (Xeno Campanoli)
Re: Hashes springing into existence [Was: more regex/pa <zenin@bawdycaste.org>
Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Q: how to search/replace (s/...) extended ascii cha (Larry Rosler)
Re: Q: how to search/replace (s/...) extended ascii cha (Ilya Zakharevich)
Re: trying to use print<<END; with CGI.pm (Ronald J Kimball)
unlink() not working in NT!!?? <standfast@mindspring.com>
Re: unlink() not working in NT!!?? (Ilya Zakharevich)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Sep 1998 02:14:51 GMT
From: bitnut1@my-dejanews.com
Subject: Re: any way to encrypt my script?
Message-Id: <6u9liq$6dv$1@nnrp1.dejanews.com>
>------------------------------------------
> Ben Sauvin <sauvin@osmic.com>: ....
> Nobody who has never written or maintained a compiler, interpreter
> or other computer language translator should really be commenting in
> this thread.
>------------------------------------------
Your suggestion that only compiler writers should talk about them
is akin to saying that only astronauts should talk about stars.
Fortunately, theories and observations are perfectly acceptable in
all sciences even when not derived from direct work in the field.
B.N.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 22 Sep 1998 22:42:09 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: any way to encrypt my script?
Message-Id: <1dfrv0l.1lxw9ab2xsugmN@bay1-301.quincy.ziplink.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
> In comp.lang.perl.misc,
> Ben Sauvin <sauvin@osmic.com> writes:
> : Nobody who has never written or maintained a compiler, interpreter
> :or other computer language translator should really be commenting in
> :this thread.
>
> Why's that -- because we're the only ones who know what we're talking
> about? :-)
Hmm..... :-)
> More seriously, there is a reason that professional computer scientists
> go to school for 4-8 years studying and researching these things, and
> why we have specific words with precise technical meanings. Telling us
> we're not allowed to participate is biting the hand that feeds you.
> Without us, the world would be stuck with nothing more than a bunch of
> mere [insert Scott Adams accent voice here] ``IT Professionals''. :-)
Tom, you've got his meaning backwards.
He said 'nobody who has *never* written or maintained, etc.' An
unfortunate double negative. To rephrase, 'Only people who have ever
written or maintained a compiler, interpreter, or other computer
language translator should really be commenting in this thread.'
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Wed, 23 Sep 1998 01:01:08 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Change chars in STDOUT?
Message-Id: <360849E1.F46D0F46@shaw.wave.ca>
[posted & mailed]
Christopher Marquis wrote:
>
> I'm trying to do a cute little password routine. But I can't think of
> a way of replacing everything typed to echo back a "*" or something
> like it instead of what is really being typed.
See perlfaq8, "How do I ask the user for a password?"
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Tue, 22 Sep 1998 22:42:14 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Change chars in STDOUT?
Message-Id: <1dfrvio.193o26w15tag0lN@bay1-301.quincy.ziplink.net>
Christopher Marquis <Christopher.Marquis@fairchildsemi.com> wrote:
> So spawning of stty and changing it outside of the program is the only way of
> doing this. There isn't a native Perl way of doing this I take it?
Nope, that's not the only way.
As it happens, this is a frequently asked question.
>From perlfaq8:
How do I ask the user for a password?
(This question has nothing to do with the web. See a different
FAQ for that.)
There's an example of this in L<perlfunc/crypt>). First, you put
the terminal into "no echo" mode, then just read the password
normally. You may do this with an old-style ioctl() function, POSIX
terminal control (see L<POSIX>, and Chapter 7 of the Camel), or a call
to the B<stty> program, with varying degrees of portability.
You can also do this for most systems using the Term::ReadKey module
from CPAN, which is easier to use and in theory more portable.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 22 Sep 1998 22:12:21 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: changing $ 'variables' in regexprs
Message-Id: <1dfs2mf.1fjucdzeaxu95N@roxboro0-038.dyn.interpath.net>
Uri Guttman <uri@camel.fastserv.com> wrote:
> >>>>> "JM" == John Moreno <phenix@interpath.com> writes:
>
> JM> /e is only mentioned tangentially:
>
> JM> ### from perlre.pod ###
> JM> WARNING on \1 vs $1
> JM> -snip-
> JM> However, if you get into the habit of doing that, you get yourself into
> JM> trouble if you then add an /e modifier.
> JM> ### from perlre.pod ###
>
> since you used uc in the replacement string you had to use /e. my point
> was to use \U and you don't need /e or uc.
Absolutely. You're right - \U is better/shorter.
> JM> Also - it's not clear (or it at least it wasn't to me) that when \U
> JM> is mentioned that it works on both sides of a substitution.
>
> from perlop.pod
-snip-
> the replacement is s/// is a double quotish string so all \U and its ilk
> work just fine. the text doesn't mention anything but variable
> interpolation but that implies double quotes. i think camel says it
> better but i don't have it at work.
Well, no matter how well it's said in the camel or even perlop.pod, I
*still* think it should be mentioned in perlre.pod. When I'm trying to
figure out how to do a regular expression I do NOT start in perlop, I
start in perlre.
--
John Moreno
------------------------------
Date: 23 Sep 1998 02:00:54 GMT
From: xeno@aa.net (Xeno Campanoli)
Subject: Re: Cookie Help!
Message-Id: <6u9kom$lte$1@slave3.aa.net>
I just had some problems using CGI.pm cookies with an old download (6 months) of CGI.pm...I got the latest
version and it now works fine. Could have been something I did wrong with the original installation, but,
well, whatever it was, the latest works fine.
brian d foy (comdog@computerdog.com) wrote:
: In article <3606AD7B.B5BCF615@horizonlive.com>, Rasan Rasch <rasan@horizonlive.com> posted:
: >> Can anyone direct me to (hopefully) an on-line or downloadable file that
: >> explains how to use cookies; ie. writing, reading, etc.
: >
: >You should use CGI.pm.
: >http://stein.cshl.org/WWW/software/CGI/cgi_docs.html
: >There should be a section on cookies with an example script.
: one might also look at the CGI Meta FAQ which contains references
: to many cookie resources, including the above module.
: good luck :)
: --
: brian d foy <comdog@computerdog.com>
: CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
: Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
: Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
--
Xeno Campanoli
Onex - Linux consulting, software analysis, design, and implementation
Email: xeno@aa.net
------------------------------
Date: 23 Sep 1998 01:42:01 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Hashes springing into existence [Was: more regex/pattern substitution]
Message-Id: <906514839.26393@thrush.omix.com>
Daniel Grisinger <dgris@perrin.dimensional.com> wrote:
>snip<
: It's an artifact of autovivification.
:
: Perl sees C< exists $foo{bar}{baz}; > and creates $foo{bar},
: hanging an empty hash reference off of it, on it's way to
: check if {baz} exists.
:
: This is moderately annoying, but I'd imagine that fixing it
: would break a lot of things (not to mention that fixing it
: would almost certainly slow C<exists> way down).
It should speed it up I'd think.
If $foo{bar} does not exist we currently have:
-Detect $foo{bar} does not exist
-Create $foo{bar}
-exists() on $foo{bar}{baz}
-return
Fixing this would give us:
-exists() on $foo{bar}
-return
If it's deeper, the same thing happends for each level. So,
the question is which is faster, simple exists(), or
autovivification? Since autovivification implies exists() at
each level already, I'd bet exists() would be faster, regardless
of the depth.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 23 Sep 1998 01:35:31 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906514448.968782@thrush.omix.com>
George Reese <borg@imaginary.com> wrote:
>snip<
: So let's review. You have worked hard to get three quotes. Of the
: three quotes, you have one quote that, taken alone out of context,
: *might* lead one to the *assumption* that I am suggesting OO is
: everything.
And if one refers back to the articles those quotes where taken
from, it would prove this viewpoint beyond any doubt.
If you've had a change of heart after going through this thread,
have the dignity to admit it, but don't patronize the other
readers here by suggesting that you never thought "OO is
everything". That's a lie, as the first 3/4ths of this thread
clearly prove.
: On the other hand, you have many, many posts of me explicitly saying
: otherwise.
In your last few posts, sure. This is just more of the massive
amount of contradictions you keep making. If you want to make
believe you never wrote any of the things you've written, you might
want to see about getting your articles removed from DejaNews.
: Clearly you desperately want to assign this belief to me. By doing
: so, you can write me off as a zealot who does not understand the real
: world. Give it up. I do not hold that belief, I have never held that
: belief, and throughout the entire thread I have done nothing to
: promote that belief.
Ya see, that's just it. With the exception of the last few
posts from you, the only thing you have done throughout this entire
thread is prove yourself a zealot.
: : This begs the question of whether the OO paradigm *ought* to be
: : maintained across the process. Clearly, you think it does.
:
: And I have provided support for that belief in other posts. I even
: went so far as to sum it up into premises and a conclusion.
Your own assertions do not equal "support".
: :> You should parse the [pattern match] results within an OO framework.
:
: : This is saying that all operations, regardless of scale, should
: : be performed in an OO framework. Which sounds a lot like
: : "OO Everywhere" to me.
:
: How does it sound like that?
Keywords, "You should".
: Again, you took the quote out of context.
Ok, stick it back in context. It binds this line of thought
even stronger.
: The context was not so much that pattern match results
: should be in an OO framework, but that they should be handled within
: some structure imposed by the language in question.
And we'd all agree with you, if that was indeed what you said.
Read that comment above again. Basically you're saying if you
have a hammer and a nail that you should not try to use the hammer
on the nail as you would a screwdriver.
: For example, lisp pattern matching is not OO, but it is handled within
: the Lisp paradigm. I support that for Lisp. I support the OO paradigm
: for python. Perl, however, is a hodge podge of paradigms. And I do not
: support that.
So basically, if one is using language Foo and comes to a problem
that is best solved with the paradigm of language Bar, that it is
best to create a workaround kluge using only Foo's paradigm?
What if Java had closures. Would it be "wrong" to actually use them?
Or would Java some how be less of a language for even supporting
such a paradigm?
>snip<
: What? Please try and describe how you get that from the above
: quotes. As I read them, they are all variations of: "if you want code
: reuse, OO is the way to go".
Which, without sighting evidence you still have failed to
provide, is dogma.
: : So, are we unclear as to where you stand on OO?
:
: Evidently, you are. And what is really funny, you will not take my
: explicit statements as proof.
You could be Jesus. Your statements alone would still not be
"proof". Maybe you have a different definition of "proof" then
the rest of us?
: You instead spend a lot of time reading into other statements
: non-explicit meanings.
Oh, you've been quite explicit. There is no need to read anything
into your statements as you've made yourself quite clear.
>snip<
: This is true only if the strength of perl lies in where OO is weak.
: This is not the case. OO's weakness lies in performance of speed
: critical systems--usually in the embedded systems world.
:
: For those things where taking an OO approach will not work, perl,
: python, and java are all bad solutions.
So, the only reason OO design should ever not be used is
performance? So, if OO had no performance issues, it would
have no weaknesses? Now you're back on the "OO Everywhere"
theme. You flip-flop faster then a politician.
: : (Of course, I admit that that is faulty, since in fact Python does
: : not enforce OO any more than Perl does. But that's a different
: : argument...)
:
: Would you care to back this up?
Why bother? DejaNews already has a copy of your python own code
that proves it.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Wed, 23 Sep 1998 02:11:26 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <iNYN1.1486$Ge.4670316@ptah.visi.com>
In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
: George Reese wrote:
:>
:> I have shown rational arguments to backup OO software engineering as a
:> good paradigm for development in the large. I have not referenced any
:> authorities as some sort of argument from authority. I have simply
:> provided many, many reasons.
: Clearly you prefer to take your chances standing on your own authority.
: But as a skeptic, I would much prefer that you had referenced other
: authorities whom I respect; it would have done much more for your case.
I have not referenced myself as an authority and I do not reference
anyone else as an authority. Argument from authority is an invalid
form of argument. I have presented an argument that you can take or
leave on its own merits.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Wed, 23 Sep 1998 02:19:33 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <VUYN1.1489$Ge.4670316@ptah.visi.com>
In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
: George Reese wrote:
:>
:> In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
:> : I am saying that the usefulness of Amazon rankings is limited
:> : like this: it is not the absolute ratio of favorable to
:> : unfavorable reviews for a book that matters; it is the relative
:> : ratio, compared to the ratios for other books. Nearly every
:> : book reviewed at Amazon has a preponderance of favorable reviews.
:> : Does that mean that all these books are good? Of course not.
:> : Any book that gets an unusually large proportion of unfavorable
:> : reviews -- even if it is still less than half -- is probably
:> : a pretty poor book, to have motivated that many people to log
:> : on and submit a review.
:>
:> : Of course, the other problem is sheer sample size: very few
:> : books get enough reviews of (any kind) to be statistically
:> : significant.
:>
:> This would be an excellent point if it were *I* who was offering up
:> the reviews at amazon.com as having any meaning. I was in fact
:> responding to someone else who tried to read meaning into them that
:> did not exist.
: Well, actually, it's an excellent point, regardless of who might
: take it as argumentative. The point is, if your book has more than
: a tiny number of negative reviews, that says something (not favorable)
: about your book.
It doesn't! It has one negative review by some dude who was
complaining because I did not provide an example of accessing an MS
Access database. Keep in mind, JDBC is a database-independent
API--there is no reason to show examples with any particular database
engine.
Again, some comments were offered up, taken out of context, of the
reviews in which they were given and presented as negative. It was
offered as if that said something about my book.
I posted a response showing how they were not negative comments and in
fact these same reviewers were giving my book 3, 4, and 5 stars and
then you tell me all this means nothing.
You cannot have it both ways.
And this is a stupid argument anyways. Whether or not I have written
a book is completely irrelevant. Whether or not it is any good is
completely irrelevant. I happen to think it is very good and I
consistently get positive feedback on it. If you
really want to judge it, buy it and post a review to
comp.lang.java.programmer. Either way, it has no bearing on this
thread.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Wed, 23 Sep 1998 02:43:08 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <0fZN1.1493$Ge.4670316@ptah.visi.com>
In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
: George Reese wrote:
:> John Porter wrote:
:> : This begs the question of whether the OO paradigm *ought* to be
:> : maintained across the process. Clearly, you think it does.
:>
:> And I have provided support for that belief in other posts.
: You keep saying that, but it still isn't true.
: You have not ever (in this thread) provided one shred of EVIDENCE
: for anything. You repeat the same claims, over and over, one of
: which is that you've provided support for the others. It's a lie.
: You have NOT, EVER ONCE provided ANY EVIDENCE for the claims you
: have made.
I have provided premises which you can debate or not. You have not
chosen to debate those premises. What exactly do you want?
If I say:
All Americans speak French.
I am American.
Therefore I speak French.
As this argument follows from the premises, I have provided an
argument with support. You can either choose to debate my premises or
concede that I speak French.
:> I even went so far as to sum it up into premises and a conclusion.
: Yeah, that's pretty far, all right.
: You really went beyond the call of duty on that one.
How often do people reduce their arguments to their logical form in
USENET or any other forum? Pretty close to never. Either way, given
that I have, it is disingenuous of anyone to suggest I have not
supported my argument.
:> :> You should parse the [pattern match] results within an OO framework.
:>
:> : This is saying that all operations, regardless of scale, should
:> : be performed in an OO framework. Which sounds a lot like
:> : "OO Everywhere" to me.
:>
:> How does it sound like that? Again, you took the quote out of
:> context. The context was not so much that pattern match results
:> should be in an OO framework, but that they should be handled within
:> some structure imposed by the language in question. For example, lisp
:> pattern matching is not OO, but it is handled within the Lisp
:> paradigm. I support that for Lisp. I support the OO paradigm for
:> python.
: That's nice, and I appreciate you saying that.
: But can you see how I might have gotten "confused"?
:>:> You should parse the results within an OO framework.
: I'm supposed to have eisegeted "...if programming in a language
: which supports OO"?
: I eisegeted "...always, and therefore always use a language which
: supports OO", which, obviously, would be a rather fanatical
: claim to make.
I think this is a result of you wanting to pidgeon hole me as a
fanatic. Either way, however, let's leave this one behind us.
:> :> If [the code] is properly OO, it is very likely to be reusable.
:>
:> :> OO is the single best path to code reuse.
:>
:> :> software reuse does not make something OO.
:>
:> : These statements clearly betray your priorities: you think the
:> : means (OO) is more important than the end (code reuse).
:>
:> What? Please try and describe how you get that from the above
:> quotes. As I read them, they are all variations of: "if you want code
:> reuse, OO is the way to go".
: The third quote is the key.
: "Software reuse does not make something OO."
: True, but so what?
: If I have achieved reuse -- by whatever means -- so what if is
: or isn't via OO? The (unfortunate?) fact of the matter is that
: software reuse occurs outside of any OO framework a lot, and
: that should not be denigrated. Besides, it is still debatable
: just how effective OO is at leading to reuse. Debatable, at least,
: for those who haven't preconcluded it.
I forget the exact context, but this says to me that someone was
claiming that the sole goal of OO is reuse. A lot of people do in
fact make that claim and my general response to that is that reuse
does not render something OO. It is not a comment on the primacy of OO.
:> And what is really funny, you will not take my
:> explicit statements as proof.
: Sorry, chum, but your statements do not constitute proof.
: You could be Knuth, and your statements alone would not
: constitute proof.
: If you actually offer some proof, then I'll consider that.
: Show me some case studies, some hard numbers; that would
: be a little more like proof.
You are taking my quotes out of context again. I was talking about
you not taking my statements of proof of what I think. My statements
are most definitely proof of what I think. In other words, if I state
"my kitty cat is purple" that is good proof I think my cat is purple.
:> For those things where taking an OO approach will not work, perl,
:> python, and java are all bad solutions.
: Which is to say, in the problem domain in which perl, python, and
: java are not bad solutions, OO is the best approach.
: Again, close enough to "OO is Everything" as makes no difference.
: (Yes, let's ignore embedded real-time systems. Fair enough?)
If you say "ignore everything in which OO is not a good solution",
yes, my response will be "OO is everything".
Also, if you say ignore everyone who does not speak English, the
statement "the whole world speaks English" is true.
If you want a meaningful quote from me, here it is:
Any group development product or any development product that has a
chance of a long life cycle whose functionality could be accomplished
in perl should be approached from an OO point of view and not in fact
be done in perl.
I think the premises I have offered in this past support this
statement. If you disagree, please address the problematic premise.
:> : (Of course, I admit that that is faulty, since in fact Python does
:> : not enforce OO any more than Perl does. But that's a different
:> : argument...)
:>
:> Would you care to back this up?
: Of the two samples of Python code presented in this thread -- one
: of which was penned by you -- neither was written in object-oriented
: style. They were strictly procedural, except for calls to some
: externally defined objects (sys, regex, cgi). Before you jump the gun
: on what I am saying here, I am NOT saying that those examples were
: poorly written, or were not written appropriately to the task.
: My point is that Python did not, apparently, force the programmer to
: code in an OO style. Which is to say, he defined no new classes or
: derived classes; and none of the new code was contained in a method.
: It was all plain ol' Pascal-like procedural code.
: If you can't find the code samples I'm referring to on your news
: server or on DejaNews, I'll do it for you.
I am aware of the code. And no language absolutely positively forces
you to program in an OO manner. I can program procedurally in any
language. The more OO the language, the more you have to work to code
procedurally.
For the type of program in question, the goal was that someone wanted
me to mimic some perl code. It was not offered as proof of anything.
Furthermore, any hello world program in any language will appear
procedural unless you do something really bizarre. And that was
nothing more than a fancy hello world program.
:> : Btw, can you say how well (if at all) Python supports a functional
:> : programming style? Does it have closures, partial evaluation, and
:> : continuations? Just curious...
:>
:> Start a new thread on python programming if you want to go into this.
: If you are at all interested in that topic, please email me. Thanks.
You are better off discussing these things with a python expert. I
know enough to know that the answer is more complex than a yes/no
answer. But I am not enough of a python programmer to have a
meaningfully detailed discussion on it.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Tue, 22 Sep 1998 19:16:24 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: how to search/replace (s/...) extended ascii characters?
Message-Id: <MPG.1071f9cda8048c3a98987e@nntp.hpl.hp.com>
In article <1dfs6sx.ohasmjca5ep2N@host063-210.seicom.net> on Wed, 23 Sep
1998 00:03:13 +0100, Joergen W. Lang
<jwl@_munged_part_of_address_worldmusic.de> says...
> #!/usr/bin/perl -w
> use locale; # here's your friend...
>
> $_ = "Hi, my name is Jxrgen. Blame my parents.";
> s/x/oe/;
> print;
> __END__
> prints: "Hi, my name is Joergen. Blame my parents."
Yes, it does, but it also prints it that way without 'use locale;'.
If I understand correctly, the locale setting affects such things as \w,
uc and lc, and cmp. It doesn't have anything to do with the matching of
an ordinary 8-bit character, as in this case.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 23 Sep 1998 02:27:51 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Q: how to search/replace (s/...) extended ascii characters?
Message-Id: <6u9mb7$eev$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Joergen W. Lang
<jwl@_munged_part_of_address_worldmusic.de>],
who wrote in article <1dfs6sx.ohasmjca5ep2N@host063-210.seicom.net>:
> #!/usr/bin/perl -w
> use locale; # here's your friend...
>
> $_ = "Hi, my name is Jxrgen. Blame my parents.";
> s/x/oe/;
This has nothing to do with locale, since it uses no locale-specific
info (as in "What is word-char", "how to uppercase x", and so on).
Hope this helps,
Ilya
------------------------------
Date: Tue, 22 Sep 1998 22:42:16 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: trying to use print<<END; with CGI.pm
Message-Id: <1dfs3xa.svkfcm1xif060N@bay1-301.quincy.ziplink.net>
Harold Bamford <hbamford@marconi.ih.lucent.com> wrote:
> >print<<END;
> >
> >Al,
> > What is it doing? Just saying that
> > it is not working _without_ a code
> > sample doesn't help us troubleshoot
> > the problem.
> >
> >Brent
> >
> >END
>
> Well, it works OK for me. However, since 'END' has special
> significance to Perl, you might want to try a different token:
Although you don't have to, because using END does work.
~> perl
print <<END;
Hi!
END
__END__
Hi!
Presumably, this is because the first END is protected by the <<
operator, and the second END is protected by the fact that it is a
delimiter.
BEGIN works too.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 22 Sep 1998 19:17:52 -0700
From: "David Watson" <standfast@mindspring.com>
Subject: unlink() not working in NT!!??
Message-Id: <36085a50$0$25505@nntp1.ba.best.com>
The following piece of code fails the call to unlink() in NT -- but not in
Unix. On NT, the created file remains after the program finishes. The
file, on an NTFS filesystem, is created with permissions including
Everyone:C (which I take to mean that it should be deletable).
Help! What am I forgetting??
Thanks,
-David.
# The open() succeeds. The unlink() fails only on NT.
#
$thefile = "C:/tmp/perltest";
if (!open(TEST, "> $thefile")) {
die($errno);
}
print("Opened OK\n");
$result = unlink "$thefile" ;
printf("Result is %s\n", $result);
------------------------------
Date: 23 Sep 1998 02:30:55 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: unlink() not working in NT!!??
Message-Id: <6u9mgv$fj3$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to David Watson
<standfast@mindspring.com>],
who wrote in article <36085a50$0$25505@nntp1.ba.best.com>:
> The following piece of code fails the call to unlink() in NT -- but not in
> Unix. On NT, the created file remains after the program finishes. The
> file, on an NTFS filesystem, is created with permissions including
> Everyone:C (which I take to mean that it should be deletable).
>
> Help! What am I forgetting??
Checking $!. On contemporary systems mandatory locking is available.
For example, you cannot unlink an open file (this is a result of an
absense of link count in the filesystem).
> # The open() succeeds. The unlink() fails only on NT.
> #
>
> $thefile = "C:/tmp/perltest";
>
> if (!open(TEST, "> $thefile")) {
> die($errno);
> }
>
> print("Opened OK\n");
>
> $result = unlink "$thefile" ;
> printf("Result is %s\n", $result);
Ilya
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3792
**************************************