[8296] in Perl-Users-Digest
Perl-Users Digest, Issue: 1914 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 17 00:08:21 1998
Date: Mon, 16 Feb 98 21:01:44 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 16 Feb 1998 Volume: 8 Number: 1914
Today's topics:
Strange syntax error (Jasper O'Malley)
Re: Stripping HTML tags in 5.004 <rra@stanford.edu>
Re: substitution/expression (P. Stephen Jensen)
Re: System function to variable <michael@datahost.com>
Re: System function to variable <tchrist@mox.perl.com>
Re: The Young Man and the Beach (Richard Bellavance)
Re: The Young Man and the Beach (Richard Bellavance)
Re: The Young Man and the Beach <rra@stanford.edu>
Re: The Young Man and the Beach <gbarr@ti.com>
Re: The Young Man and the Beach (Mark Kramer)
Re: The Young Man and the Beach (Nathan V. Patwardhan)
what is exaclty the "_" Variable ?!?! <vlierd@uni-oldenburg.de>
Win32::EventLog (eichner)
XS help? (dave)
Re: Year 2000 Compliance: Lawyers, Liars, and Perl lvirden@cas.org
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Feb 98 16:33:45 GMT
From: jooji@orion.webspan.net (Jasper O'Malley)
Subject: Strange syntax error
Message-Id: <jooji.887560425@orion.webspan.net>
I don't suppose anyone could tell me what's wrong with this line?
die("deluser: Password file is busy\n") if ( -f "/etc/ptmp" );
I get the following when I attempt to run the program:
syntax error at ./deluser.pl line 10, near ") if"
Execution of ./deluser.pl aborted due to compilation errors.
Cheers,
Mick
--
The Reverend Jasper P. O'Malley dotdot:jooji@webspan.net
Freelance Crackerjack ringring:1800fubared
SEND HELP woowoo:http://www.webspan.net/~jooji
------------------------------
Date: 16 Feb 1998 10:43:58 -0800
From: Russ Allbery <rra@stanford.edu>
To: andrew.haylett@primag.co.uk
Subject: Re: Stripping HTML tags in 5.004
Message-Id: <m3btw7e6fl.fsf@windlord.Stanford.EDU>
[ Posted and mailed. ]
Andrew Haylett <ajh@primag.co.uk> writes:
> "perldoc perlfaq9" yields the RE s/<(?:[^>'"]*|(['"]).*?\1)*>//gs,
> which works fine in 5.001 but bites the dust in 5.004 ("regexp *+
> operand could be empty").
At least by my eyeballing of it, s/<(?:[^>'"]+|(['"]).*?\1)*>//gs should
be equivalent and not have that problem.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 16 Feb 1998 15:39:42 GMT
From: pjensen@interactdirect.com (P. Stephen Jensen)
Subject: Re: substitution/expression
Message-Id: <34e85d31.511094404@news.wwdc.com>
On Tue, 10 Feb 1998 09:40:31 -0500, tloser@valdemar.microserve.com
(Thomas A. Loser) wrote:
> I am attempting to capitalize any character in a field that follows a " " or
>a "/". Forget doubling them up, right now I'd settle for getting *either* to
>work. According to the manuals (camel 2nd ed p73) I should be able to put an
>expression as the 2nd part of a substitution. But when I try:
>
>$field = "Tom jerry";
>$field =~ s/ [a-z]/(uc $&)/e;
>print $field;
>
>all I get is: "Tomerry"
This seems to work:
$field =~ s/(\s|\/)([a-z])/$1\U$2/g;
Doubtless there are more elegant/effcient ways to do it, but I'm a
newbie too.
- P
-----
P. Stephen Jensen
Interact Direct Limited
London, Ontario, Canada
http://www.interactdirect.com
"A golden rule... to leave an incomplete image of oneself."
-- E.M. Cioran
------------------------------
Date: Sun, 15 Feb 1998 20:21:42 -0800
From: Michael Stearns <michael@datahost.com>
Subject: Re: System function to variable
Message-Id: <34E7BED6.145A@datahost.com>
TC offered several suggestions, after which I still have some questions.
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, michael@datahost.com writes:
> :I am trying to get the current date and stick it in a variable.
>
> Is there some reason why neither the scalar sense localtime
> nor the POSIX::strftime is to your liking?
Since I was able to get the unix date command to work I thought this
would be simple. Since I am somewhat of a beginner, it seems like there
would be quite a lot of overhead involved to install a module and figure
out how it works, when all I want is one dinky command.
>
> :I have tried several things like:
> :$tempdate ="date '+%A %B %e, %Y'";
> :$temppath1= "tempfile";
> :system ($tempdate) >> $temppath1;
>
> Hello? Ceci n'est pas un shell. That's a rightward bitshift operator,
> and highly silly. Did you know that -w would have pointed this out?
Thanks, I will try -w.
>
> Did you also know that man perlfaq8 contains the following question:
>
> Why can't I get the output of a command with system()?
I looked at http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html,
both before you suggested this and after. I still don't see it.
>
> :open (DATEVAR,"+< tempfile") || die ("Can't Open tempfile\n");
>
> Did you know that if you don't print $!, no one will ever know
> why it didn't work?
Thanks. I will try this.
Although I will assume from your comments that you think the approach I
am taking is not very good, the fact remains that the script is
returning the values that I want, I just don't undertand how to capture
them in a variable.
I will investigate localtime, but when I go to the perlfunc man page and
look under localtime, I don't see how to change localtime into the
format I need for my application, without using the POSIX module. As I
stated earlier, since this is "unknown territory" for me and I already
seem quite close to getting this to work. The smarter approach seems to
use the system call. Of course if it doesn't work to assign the system
call to a variable, I suppose this is not a good approach. I will
continue to search the faqs for the question you pointed me to
Thanks,
Michael Stearns
>
> --tom
------------------------------
Date: 16 Feb 1998 13:15:11 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: System function to variable
Message-Id: <6c9e4v$nk5$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, michael@datahost.com writes:
:Since I was able to get the unix date command to work I thought this
:would be simple. Since I am somewhat of a beginner, it seems like there
:would be quite a lot of overhead involved to install a module and figure
:out how it works, when all I want is one dinky command.
POSIX is one of the standard modules, although you can do most
of what strftime does on your own using printf.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
SCCS, the source motel! Programs check in and never check out!
--Ken Thompson
------------------------------
Date: 16 Feb 1998 13:12:23 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: The Young Man and the Beach
Message-Id: <6c9vi7$rcl@ocean.CAM.ORG>
In article <6c9qri$eq4@fridge.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>Richard Bellavance (charlot@CAM.ORG) wrote:
>
>: Here, here ! If only more people could think of posting to Usenet as not
>: just a right (which it is), but also as an act that carries responsabilities
>
>Posting to Usenet (and having an account on someone else's machine)
>isn't a right if I recall correctly. Did I misunderstand your posting
>where I thought that you said, "posting to Usenet is a right..." in my
>interpretation? Please clarify.
>
"posting to usenet" and "having an account on someone else's machine" are two
different things. (of course, you need an account to access Usenet...)
What I meant to say is that if you have an Internet account, you have the right
to post a message to Usenet. Do note that I don't mean anyone *should* post
anything anywhere, but simply that one *can*. Maybe I should say "anyone has
the right" instead of "posting is a right" ?
Richard, whose native tongue is not english.
--
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: 16 Feb 1998 19:44:35 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: The Young Man and the Beach
Message-Id: <6camhj$7us@ocean.CAM.ORG>
In article <6ca7qn$19h@fridge.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>Richard Bellavance (charlot@CAM.ORG) wrote:
>
>: "posting to usenet" and "having an account on someone else's machine" are two
>: different things. (of course, you need an account to access Usenet...)
>: What I meant to say is that if you have an Internet account, you
>: have the right to post a message to Usenet.
>
>No, you don't. I've had many accounts over the years, and not one of
>these accounts entitled me to "right to service" on Usenet or
>*anywhere*. Don't forget that even if you have your *own* newsserver,
>you still need to get someone who will feed to you.
>
Oh, come on ! This is nitpicking in the extreme ! When you sign up with an
Internet provider, you have access to Usenet, right ? (If you don't, I
advise you to change provider) And then you can (or not) post messages to
Usenet if you want to (or not). But nobody will stop you from posting if
you want to. Nowhere is it written "thou art forbidden to cast your thoughts
onto Usenet". That's what I mean by "having the right to".
BTW, I notice that you chose not to quote the part of my message that read:
maybe I should say "has the right to" instead of "posting is a right"
Anyway, this is seriously off-topic. I don't mind continuing this by
e-mail, but I've set the followups to end this part of the thread.
Richard.
--
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: 16 Feb 1998 10:41:30 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: The Young Man and the Beach
Message-Id: <m3en13e6jp.fsf@windlord.Stanford.EDU>
Mark Kramer <c28f62@world.std.com> writes:
> I guess you didn't read the fable you are so busy defending, or maybe
> you didn't understand the allegory. The beach is this newsgroup. When
> the "Young Man" visited the beach, he didn't find anything BUT rabble.
> Graham is here. You figure the rest of it out.
There are some things on Usenet one either has to understand and accept or
ignore. Excessive interpretation followed by endless argument concerning
them accomplishes absolutely nothing. You're obsessing over trivia,
drawing conclusions that aren't warranted, and engaging in extended
detailed discussion of something that wasn't intended to be understood at
that level, and you're not even doing the newsgroup as a whole the
courtesy of answering questions in the process of doing so.
Please stop.
> Agree with you or leave. I see. There was a time on Usenet when people
> could have differences of opinion without ths sort of ultimatum.
No there wasn't. *That* part of Usenet culture, at the very least, has
remained pretty near constant for years and has been responsible for the
creation of not a few additional newsgroups.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 16 Feb 1998 08:05:02 -0600
From: Graham Barr <gbarr@ti.com>
Subject: Re: The Young Man and the Beach
Message-Id: <34E8478E.E80EB738@ti.com>
Mark Kramer wrote:
>
> In article <34E45CDC.D6B5D299@ti.com>, Graham Barr <gbarr@ti.com> wrote:
> >Mark Kramer wrote:
> ><ungrateful gibberish deleted>
>
> Ok, Mr. Barr.
Whenever someone calls me "Mr Barr" I always think I have pissed
them off in some way.
> You tell me, exactly, what I was supposed to be grateful
> for in the fable Tom posted. Was I supposed to be grateful that he
> compared all of us to dirty beggars and shoeless children?
Tom did not compare you, or anyone else, to dirty beggars. He simply
posted a fable which had some resemblance to what is happening on
this group. It was you who compared yourself to a dirty beggar,
so if you do not like it I suggest you do something about it.
> Was I
> supposed to be grateful for his reference to all the human debris on
> "his beach"? No, you don't get to exclude yourself from his fable,
> since he did not find any of his old friends on the beach, just the
> rabble.
No I do not exclude myself, but then I did not take it personally
either.
>
> Or maybe what I was supposed to be grateful for was the way he was
> jumping down people's throats for picking the wrong newsreader to post
> to his group?
>
> You tell me, Mr. Barr. Which is it?
oo, you seem so wound up, belive me it is not worth it, just calm down
> As for his "soul" purpose being to "help", well, I can state without
> hesitation that his vendettas helped nobody. It increased the noise
> and drew attention to himself, that's all.
I can assure you that there are *very* few people in this group
who would agree that Tom's purpose of reading this group is for
anything other than to help.
--
Originality is the ability to conceal your source.
------------------------------
Date: Mon, 16 Feb 1998 16:40:42 GMT
From: c28f62@world.std.com (Mark Kramer)
Subject: Re: The Young Man and the Beach
Message-Id: <EoHCzu.1x8@world.std.com>
In article <fl_aggie-1502981152580001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>In article <34f5087b.14642181@news.tornado.be>, bart.mediamind@tornado.be
>(Bart Lateur) wrote:
>
>+ How dare I. I can see Mark Kramer's point.
>
>Please share. All I see is Kramer's Whine.
Perhaps because you didn't read Tom's comments?
>I don't expect that, not at all. Courtesy and consideration, which seems
>to be the point -- tho I'm not sure -- IS A TWO WAY STREET. You want me
Nothing I wrote said anything about what I want YOU to do. Not one
word. I pointed out that flaming people for which newsreader they used
was not helping, and then when the grandly eloquent fable was posted,
pointed out that it insulted a lot of people who didn't deserve it.
When you stoop to the level of OS flaming for the sake of OS flaming,
we'll talk about what you are doing.
>Again, courtesy is a two way street. But the victims of the malformed
>posts are the _senders_.
And I will tell you again, since you didn't bother reading it the first
time, many of the poeple Tom flamed for being scummy users of scummy
software had posted properly formatted articles. There was NOTHING
wrong with them, except they had an X-Mailer header. They might have asked
a simple question, but that had nothing to do with the newsreader.
>And they're entitled to their opinions. But that doesn't change the fact
>that:
And none of those facts change the fact that insulting people for no
reason is not even close to helping them.
------------------------------
Date: 16 Feb 1998 16:52:02 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: The Young Man and the Beach
Message-Id: <6c9qri$eq4@fridge.shore.net>
Richard Bellavance (charlot@CAM.ORG) wrote:
: Here, here ! If only more people could think of posting to Usenet as not
: just a right (which it is), but also as an act that carries responsabilities
Posting to Usenet (and having an account on someone else's machine)
isn't a right if I recall correctly. Did I misunderstand your posting
where I thought that you said, "posting to Usenet is a right..." in my
interpretation? Please clarify.
--
Nathan V. Patwardhan
please don't send spam to president@whitehouse.gov
------------------------------
Date: Mon, 16 Feb 1998 13:50:22 +0100
From: Claus van de Vlierd <vlierd@uni-oldenburg.de>
Subject: what is exaclty the "_" Variable ?!?!
Message-Id: <34E8360E.372D71FF@uni-oldenburg.de>
I did not find in Larry Wall's "Programming Perl" - book
(O'Reilly , second edition , September 1996) a precise
definition of this (at least for me ..) strange Variable "_" .
It seems to me , extracting form his examples , that every
operator which produces a value in the "LIST"-context automatically
does "$_ = <the list of the items the operator returns>" .
Consequently "for (1 ..10) { print; }"
prints "12345678910" because the "for"-operator (I think "for"
is an o p e r a t o r ?!) sets $_="12345678910" and"print"
prints "$_" .
Is this basically right ?!
And what am I missing ?!
if I do "@b=@a" : is the "=" - operator (provided it is one -
I do not know) putting the "_" - Variable to the list of all
components of the Array @a ?!
much riddles -- maybe I am too stupid for "PERL" (and maybe not).
Could somebody help me ?!
Thanxs in advance !!
Claus van de Vlierd
------------------------------
Date: Mon, 16 Feb 1998 13:59:40 GMT
From: eichner@gmx.de (eichner)
Subject: Win32::EventLog
Message-Id: <34e84424.19106403@news.uni-augsburg.de>
Hi,
I'm using Perl Win32 under Windows NT 4.0.
The package I want to use: Win32::EventLog.
The aim is to read the eventLog entries. The command that should do
that is Win32::ReadEventLog. After creating an eventlog object (works
fine), the subroutine ReadEventLog seems to find no entries in the
eventlog (in fact there are over 400 entries - the GetNumber
subroutine returns this value).
Whats the correct call of Win32::ReadEventLog.
A small example would be very helpfull.
Thank for any help
Michael
------------------------------
Date: Mon, 16 Feb 1998 23:50:15 GMT
From: meet@the.zoo (dave)
Subject: XS help?
Message-Id: <34e8cfa8.3007610@news.isoc.net>
I'm having a hard time understanding XS and the perlxstut, perlxs and
perlguts man pages are not helping me get the picture.
I bought Joseph and Randal's "Effective Perl Programming" which has a
lot of useful stuff but I'd like more about XS. Where can I get it?
Thanks,
Dave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dlripberXisoc.net (sub X with shunned char)
http://www.isoc.net/dlripber
/--\./==\./ee\./oo\./--\
------------------------------
Date: 16 Feb 1998 14:47:13 GMT
From: lvirden@cas.org
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <6c9jhh$9io$1@srv38s4u.cas.org>
According to Bart Lateur <bart.mediamind@tornado.be>:
:your geographic position: the correction I'm talking about is named
:after pope Gregory XIII, and the first correction took place in october
:1582. Not all countries adopted this at the same time. See this URL:
:
:http://www.magnet.ch/serendipity/hermetic/cal_stud/cal_art.htm#Gregorian_Reform
:
:So: does "cal" know about his? Does it guess where you are, so that it
:can take the appropriate correction? Of course not. At least, I hope it
:won't even try. So calenders of dates before 1752 (or 1582) are not very
:meaningful.
No, cal (on Solaris 2.5.1 at least - or gnu's cal) doesn't reflect the
above calendar correction after 1582-10-04 .
--
Larry W. Virden <URL:mailto:lvirden@cas.org> ICQ: 5744965
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
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 1914
**************************************