[25001] in Perl-Users-Digest
Perl-Users Digest, Issue: 7251 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 14 18:17:01 2004
Date: Thu, 14 Oct 2004 15:15:16 -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, 14 Oct 2004 Volume: 10 Number: 7251
Today's topics:
Re: Top posting (was Re: Concatenating an array into on <mritty@gmail.com>
Re: Top posting (was Re: Concatenating an array into on <cwilbur@mithril.chromatico.net>
Re: Top posting (was Re: Concatenating an array into on <sbryce@scottbryce.com>
Re: Top posting (was Re: Concatenating an array into on <mritty@gmail.com>
Re: Top posting (was Re: Concatenating an array into on <cwilbur@mithril.chromatico.net>
Re: Top posting (was Re: Concatenating an array into on <1usa@llenroc.ude.invalid>
Re: Top posting (was Re: Concatenating an array into on <abigail@abigail.nl>
Re: Top posting (was Re: Concatenating an array into on <abigail@abigail.nl>
Re: Top posting (was Re: Concatenating an array into on <bik.mido@tiscalinet.it>
Re: Top posting (was Re: Concatenating an array into on <bik.mido@tiscalinet.it>
Re: Top posting (was Re: Concatenating an array into on <bik.mido@tiscalinet.it>
Re: Top posting (was Re: Concatenating an array into on <bik.mido@tiscalinet.it>
Re: Top posting (was Re: Concatenating an array into on <bik.mido@tiscalinet.it>
Re: Unlink Question <dwall@fastmail.fm>
Re: Unlink Question <scottshane@earthlink.net>
Re: Unlink Question <scottshane@earthlink.net>
Re: Unlink Question <nobull@mail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 Oct 2004 18:07:56 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <0gzbd.115$pt1.16@trndny02>
"Shawn Corey" <shawn.corey@sympatico.ca> wrote in message
news:ZSybd.26185$hk6.1005667@news20.bellglobal.com...
>
> Scott Bryce wrote:
> > And if someone is responding to different parts of your post, as I
am
> > doing here, how do you keep it all in context if it is all top
posted?
>
> I call it memory.
So your theory is that the posting conventions of this group should
default to the most helpful to the people asking questions (who are more
likely to read only the followups to their own post) rather than the
people answering questions (who typically are involved with 10 or 15
threads each day)? I'm sorry, is the quality of the free and
thankless help you're getting not up to your specs? Sheesh.
>
> Scott Bryce wrote:
> > And how do you know that there isn't more of the response farther
down
> > the page? You have to read the whole post to find that out.
>
> There might be. I expect people to make their point first, then add
> explanation. Posting to newsgroup is like writing for a newspaper: You
> make your most important point first. If you don't, people will miss
> your message.
Posting to a newsgroup is NOTHING like writing for a newspaper. A
newspaper article is a static entity. One read through and you're done.
A newsgroup thread is a continually changing and dynamic entity. Bits
and pieces are added and corrected almost constantly.
Paul Lalli
------------------------------
Date: Thu, 14 Oct 2004 18:16:32 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <871xg1tbqg.fsf@mithril.chromatico.net>
>>>>> "RSB" == Richard S Beckett <spikeywan@bigfoot.com> writes:
RSB> Can someone please get a ruling from God or something as to
RSB> which system we should use across ALL newsgroups, so we can
RSB> put this to bed once and for all,
From RFC 1855, which is about the closest you're likely to find to a
ruling from God regarding newsgroups:
If you are sending a reply to a message or a posting be sure you
summarize the original at the top of the message, or include just
enough text of the original to give a context. This will make
sure readers understand when they start to read your response.
Since NetNews, especially, is proliferated by distributing the
postings from one host to another, it is possible to see a
response to a message before seeing the original. Giving context
helps everyone. But do not include the entire original!
Shoddy Microsoft software (and other shoddy software, but Microsoft is
by far the most widely used shoddy software) has defaults that
discourage bottom-posting, and as a result in a large part of the
business world top-posting is the norm. This is regrettable overall,
though often you can tell whether you are corresponding with someone
who has a clue by noticing whether he top-posts or bottom-posts in his
replies. There are also plugins available for Outlook and Outlook
Express that have sensible defaults for bottom-posting.
Further, good netiquette requires that you lurk in a group for at
least a week before posting, and if you do that, it should be trivial
to determine whether that group prefers top-posting or bottom-posting.
comp.lang.perl.misc strongly prefers bottom-posting, and if you expect
your posts to be read by people who have a clue, you would do well to
bottom-post; consistent top-posting *will* get you added to scorefiles
and killfiles. This is reinforced in the Posting Guidelines and by
the reminders to new posters; you may also note that people who
top-post out of ignorance are treated far more kindly than those who
grow belligerent over it.
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: Thu, 14 Oct 2004 12:28:31 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <10mthabstgle655@corp.supernews.com>
Paul Lalli wrote:
> So your theory is that the posting conventions of this group should
> default to the most helpful to the people asking questions (who are more
> likely to read only the followups to their own post) rather than the
> people answering questions
What about responses that involve line by line explanations of code,
such as the A Newbie Question thread from this AM? Top posting would
benefit neither the person asking the question, nor the person
answering. Especially, as is often the case, further clarification may
be needed about certain lines of code.
I hope nobody expects that kind of response to be all top posted!
In a technical newsgroup, top posting doesn't make sense.
(OK, back to work. I have GOT to get back to work...)
------------------------------
Date: Thu, 14 Oct 2004 18:42:11 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <7Mzbd.103$gf3.69@trndny08>
"Scott Bryce" <sbryce@scottbryce.com> wrote in message
news:10mthabstgle655@corp.supernews.com...
> Paul Lalli wrote:
>
> > So your theory is that the posting conventions of this group should
> > default to the most helpful to the people asking questions (who are
more
> > likely to read only the followups to their own post) rather than the
> > people answering questions
>
> What about responses that involve line by line explanations of code,
> such as the A Newbie Question thread from this AM? Top posting would
> benefit neither the person asking the question, nor the person
> answering. Especially, as is often the case, further clarification may
> be needed about certain lines of code.
I heartily agree. I was referring to his assertion that top posting is
okay because of "memory."
Paul Lalli
------------------------------
Date: Thu, 14 Oct 2004 19:19:11 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <87wtxtru6c.fsf@mithril.chromatico.net>
>>>>> "SC" == Shawn Corey <shawn.corey@sympatico.ca> writes:
SC> Personally, I like top-posting
SC> Tad McClellan wrote:
>> So long then.
SC> That's what I was saying all along: if you can't tolerate
SC> people being people, don't read newsgroups.
Actually, no, you missed Tad's point. He just added you to his killfile.
The problem with the viewpoint that says that everyone should do as he
or she wishes is that the clueful regulars here (almost?) universally
dislike top-posting. By top-posting, you mark yourself as a newbie;
by persisting in top-posting, you mark yourself as an ass. Newbies
get help; asses get killfiled.
Now, if you don't *care* that the most knowledgeable people in the
group are not seeing your posts, that's not a problem. But the vast
majority of the posters here are looking for help, and it's just
stupid for them to do something that reduces their chances of getting
the help they need.
Part of "people being people" involves learning to conform to the
social customs of the group you are trying to interact with, and one
of the social customs of this group is that top-posting is
unacceptable. Sure, you can wear cutoff jeans and a ratty T-shirt to
work; if you do that, and your workplace has a social custom of
wearing ties, you won't have a job for long. So it is with top-posting here.
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: 14 Oct 2004 20:19:54 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <Xns9582A62267FDasu1cornelledu@132.236.56.8>
Shawn Corey <shawn.corey@sympatico.ca> wrote in news:Y5wbd.26079$hk6.981644
@news20.bellglobal.com:
> Randal L. Schwartz wrote:
>> True. Nobody is forcing anyone of us experts to answer a message. If
>> you want an answer that isn't "blind leading blind", however, you
>> should try to at least understand a bit of the culture here.
> Considering the number of answers that are simply "Read the
> documentation," I don't expect the experts here to answer any
> question. The arrogance of this response assumes that everyone _knows_
> that perldoc is on their system and they can find the appropriate
> document by pure dumb luck as there is no good search mechanism in
> perldoc. And even if it had one, finding good responses to any search
> requires finding the magic words that trigger the response. Try it in
> Google, for ever good response you get, you also get tens of thousands
> of responses of irrelevant material.
That is utter nonsense. Indeed, when I first installed ActivePerl on my
Windows computer, I was not immediately aware of perldoc. On the other
hand, it took no searching to find the "Documentation" link in the
ActivePerl program group in my start menu. Clicking on that link gave me an
html page with a complete table of contents.
I am assuming anyone who wants to program knows enough of his/her system to
at least look in the equivalent of that location.
> Many of those responding forget what it is like to learn something new.
Oh no ... I remember putting some work into it myself, however, when I was
trying to learn something new.
Sinan
------------------------------
Date: 14 Oct 2004 21:46:10 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <slrncmtst2.34g.abigail@alexandra.abigail.nl>
Richard S Beckett (spikeywan@bigfoot.com) wrote on MMMMLXII September
MCMXCIII in <URL:news:cklfc8$3ms$1@newshost.mot.com>:
== > One of the prime sins to avoid is top-posting and fully quoting someone
== > else's post without actually referring to any part of it.
== >
== > Have fun learning.
== >
== > Sinan.
==
== One small question about this...
==
== In some news groups, they get upset if you top post, because they like the
== entire thread to be visible in each post from the top down. This means that
== you can pick any individual post, read from the top, and get the gist of the
== entire thread.
==
== In other newsgroups they much prefer people to top post. This means that if
== you've been reading the thread from the beginning, you don't have to trawl
== through everything that you've already read to find the latest comment, as
== it's there right at the top. If you do need to read back, then the
== information is still there.
Really? Which newsgroup would be that? I've been reading Usenet for
over 16 years, and I've yet to encounter a newsgroup where the consensus
is that top-posting is preferred.
If there was any merit in top-posting being useful, we would have seen
widespread use of it *before* webwowsers like Netscape and IE provided
a shitty interface to newsgroups.
== Both systems have their merits, and I can understand why the people in some
== groups opt for one style, and the people in other groups opt for the other
== style.
==
== However, if a person reads many newsgroups, it's a very difficult thing for
== them to know whether they're supposed to top post or bottom post in a
== particular newsgroup.
Why? One shouldn't post in a newsgroup before getting acquainted with its
way of dealing with things.
== As long as the pertinent information is there, who is to say which style is
== correct?
I do.
== Can someone please get a ruling from God or something as to which system we
== should use across ALL newsgroups, so we can put this to bed once and for
== all, 'cause I'm getting really pissed off by the anal twats who insist that
== people must post at the bottom in one newsgroup, and then a different bunch
== of anal twats who insist that you must post at the top in another group!
I don't need supernatural beings like Santa Claus, gods or elves to decide
what's good for me. I will do that myself. As for topposters, most of them
I throw in my killfile, one the first encounter of a toppost. And noone gets
out of the killfile once in there.
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
------------------------------
Date: 14 Oct 2004 21:51:03 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <slrncmtt67.34g.abigail@alexandra.abigail.nl>
Shawn Corey (shawn.corey@sympatico.ca) topposted on MMMMLXII September
MCMXCIII in <URL:news:ydtbd.26011$hk6.958301@news20.bellglobal.com>:
\\
\\ Do whatever you like. Nobody owns a newsgroup. Those that don't like
\\ what you do can skip the message. Nobody is forcing them to read it!
*PLOINK*
Abigail
--
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'
------------------------------
Date: Fri, 15 Oct 2004 00:06:25 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <i2qtm09bu6rkvh77heg1516kstfvik46hu@4ax.com>
On Thu, 14 Oct 2004 10:00:23 +0100, "Richard S Beckett"
<spikeywan@bigfoot.com> wrote:
>In other newsgroups they much prefer people to top post. This means that if
[snip]
>As long as the pertinent information is there, who is to say which style is
>correct?
HUH?!? In all fairness and earnestness to you I can't think of any
newsgroup where "they much prefer people to top post". I know of ngs
where top posting is *tolerated*, but that's a different story. And
there are amateurish, low-profile ngs where most partecipants hardly
know what top-posting is at all, let alone possible alternatives, or
tend to use bloated news clients that do not encourage properly
quoting relevant material, so *tolerating* it is "in their genetic
code", so to say.
Said this, I for one can hardly think of a more logical way to ease my
readers' understanding than properly quoting and avoiding top-posting.
Why don't you make a tiny experiment? Try to rewrite this thread as if
everybody had top-posted... ever heard about exponential growth?
The fact that, loosely speaking, information is becoming cheaper and
cheaper is not an excuse for abusing redundant unwanted and useless
bunches of it. Period!
But there's more to it: each ng (or ml, or forum or whatever it may
be) is a community and an implicit or explicit general consensus on
the accepted behavioural rules adopted there is made by the people who
take part to it, and it is natural the the most helpful people there
have a larger influence in this sense.
In any case it is natural that if a newbie or whoever *wants* to
receive help, and this is a good reason to e.g. post to a technical
ng, then they *must* at least to some degree conform to those
behavioural rules. If they don't know (about) them, they must accept
being taught to respect them.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 15 Oct 2004 00:06:26 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <d0qtm0df9u90sunn7f5lldf49sabsumuj0@4ax.com>
On Thu, 14 Oct 2004 17:41:43 +0100, "Richard S Beckett"
<spikeywan@bigfoot.com> wrote:
>If only!
>
>I think you'll have to agree that being polite is a rare occurrence in this
>ng!
Sorry, but I won't agree, though, for plainly my personal experience
is that it's just the opposite! I've *always*, I say *always* received
kind and helpful advice here, no matter what misunderstanding there
may have been. And just think that if I read my first posts here, I
feel like smiling. Or crying! ;-)
>When a newbie asks for help, by definition he's a newbie, and doesn't know a
>lot of things that seem obvious to more seasoned hackers. So when the first
>thing they do is jump down his throat for top posting, it gets my goat!
They may have good reasons for jumping down his throat, even if in
practice it is rarely so (they just *tell* him not to top post, which
is quite different!) However there are basically two possibilities:
one is to refuse the advice and insist on top posting which most
probably means refusing any on-topic advice/answer from the most
expert contributors, and the other one is to accept this fact, that
one has to quote properly to get the answer to the question he
asked... which seems to me the most intelligent choice... provided
that what he/she was *really* interested in the first place is getting
that answer as opposed to fighting and arguing for days, months, years
on a pointless subject...
Michele
--
Liberta' va cercando, ch'e' si' cara,
Come sa chi per lei vita rifiuta.
[Dante Alighieri, Purg. I, 71-72]
I am my own country - United States Confederate of Me!
[Pennywise, "My own country"]
------------------------------
Date: Fri, 15 Oct 2004 00:06:27 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <tmqtm0pd4s6lqgt8h45n7vt563cttsk9vs@4ax.com>
On 14 Oct 2004 13:59:32 +0200, Arndt Jonasson <do-not-use@invalid.net>
wrote:
>A: Because it messes up the order in which people normally read text.
>Q: Why is top-posting such a bad thing?
>A: Top-posting.
>Q: What is the most annoying thing on usenet and in e-mail?
Cool! I remember someone using this as his own .sig in some ng I
follow...
Michele
--
>It's because the universe was programmed in C++.
No, no, it was programmed in Forth. See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel in sci.math, thread "Why numbers?"
------------------------------
Date: Fri, 15 Oct 2004 00:06:28 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <anqtm0t79tjhgenp1nbhb144a3hkogfps4@4ax.com>
On 14 Oct 2004 11:37:31 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
>> Do whatever you like. Nobody owns a newsgroup. Those that don't like
>> what you do can skip the message. Nobody is forcing them to read it!
>
>Splendid idea. Before asking a question, slap the people you want to
>ask in the face a few times. They'll double their efforts to give
>you good advice.
I think thay the OP's claimed opinion was carrying along with itself
an abundant dose of sarcasm. Did you read the last line of his post?
Michele
--
#!/usr/bin/perl -lp
BEGIN{*ARGV=do{open $_,q,<,,\$/;$_}}s z^z seek DATA,11,$[;($,
=ucfirst<DATA>)=~s x .*x q^~ZEX69l^^q,^2$;][@,xe.$, zex,s e1e
q 1~BEER XX1^q~4761rA67thb ~eex ,s aba m,P..,,substr$&,$.,age
__END__
------------------------------
Date: Fri, 15 Oct 2004 00:06:29 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Top posting (was Re: Concatenating an array into one string?)
Message-Id: <mnqtm09ti1a86k9ff3jl6sf7k4g6ld26r3@4ax.com>
On Thu, 14 Oct 2004 10:33:50 -0400, Shawn Corey
<shawn.corey@sympatico.ca> wrote:
>Considering the number of answers that are simply "Read the
>documentation," I don't expect the experts here to answer any question.
D'Oh! *that* wasn't sarcasm (those who are reading the whole thread
probably know what I'm talking about!) I regret having spent my words
in your defense...
However taking into account your claim, I'd be grateful to you if you
could explain me why then I keep asking here for clarification about
my doubts and most importantly I, along with many other posters,
either newbie or regular, am continuously satisfied with the kind help
I (we) constantly receive.
>The arrogance of this response assumes that everyone _knows_ that
>perldoc is on their system and they can find the appropriate document by
>pure dumb luck as there is no good search mechanism in perldoc. And even
That should be a bare minimum! On *NIX people will be used to manpages
and getting from 'man perl' to 'perldoc <anything>' will be a pailess
path. On Windows, with AS Perl, the HTML version of the documentation
will be an alternative/parallel entry point as well. I don't think it
takes an engineering degree to find (at least one form of) the
documentation...
Also, still speaking of my own personal experience, and I consider
myself far from being a genius, I've almost always been able to find
the pieces documentation I needed without any headache. OTOH in a very
limited number of cases it's actually been hard, and then it's been
worth to ask here "where in the docs do I find more info on [...]?",
and I've always received *kind* answers!
<OT>
>if it had one, finding good responses to any search requires finding the
>magic words that trigger the response. Try it in Google, for ever good
>response you get, you also get tens of thousands of responses of
>irrelevant material.
It happens, I must admit. In the vast majority of cases, though, if
you set up your search in a smart way, then the very few hits are the
most relevant ones. You just have to learn to be smart!
</OT>
>Personally, I like top-posting as my newsreader displays the top of the
>messages first, not the bottom. I can read their response without
>plowing through material I have already read. If I have to read what was
I can't really think of any reasonable being thinking of top-posting
as convenient, but for anyone using (what I consider) a (broken)
client that quotes the whole message without distingushing marks[*].
OTOH many newsreader enhance the visual appearance of quoted material,
and even without that the '>' marks (or something similar) make it
stand out. In my case, for example, it is blue, whereas the rest of
the text is black, so I can give a quick glance to be sure about what
we're talking about: I don't have to "plow through material I have
already read", but I can easily do so if needed, whereas when dealing
with a top-posted article I'd have to plow through all of the quoted
OP to find the part I'm interested in.
IMHO the reasons you are producing to support your claim can be
applicable only to very small messages.
[*] In particular a very well known (especially for its various
vulnerabilities!) mail/news client by a notorious sw house from
Redmond, whose name I'm not mentioning...
Michele
------------------------------
Date: Thu, 14 Oct 2004 19:35:55 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Unlink Question
Message-Id: <Xns95829EAD4AF8Fdkwwashere@216.168.3.30>
Paul Lalli <mritty@gmail.com> wrote:
> "Scott Hoffman" <scottshane@earthlink.net> wrote in message
> news:BD940C4A.1A04%scottshane@earthlink.net...
[snip]
>> ## DELETE THE .TXT FILES THAT ARE OLDER THAN 1 DAY
>>
>> foreach $FILES (@FILES) {
>> if (-M "$dir/$FILES" > 1) {
>> unlink("$dir/$FILES");
>> }
>> }
>
> I'd think you can combine all this....
>
> unlink ( grep { /.txt/ && -M "$dir/$_" > 1} readdir DIR);
Yes, but then what happens if unlink fails for one or more of the
files? I like the for-loop better because error-checking code can be
added more easily. <shrug>
------------------------------
Date: Thu, 14 Oct 2004 19:39:46 GMT
From: Scott Hoffman <scottshane@earthlink.net>
Subject: Re: Unlink Question
Message-Id: <BD941F9A.2241%scottshane@earthlink.net>
Thanks Paul --
OK I checked out the perldoc. Found that I needed
"Content-type: text/html\n\n";
I executed it from the Terminal - work fine
Back to the browser - No error but no results either
Changed the Permissions to from 755 to 777 (I know, I know)
As the previous post indicated a possible permissions issue but still no
results.
This is the exact script that I ran through perl with success::
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$dir = "/Library/Webserver/Documents/unlink_text" ;
opendir (DIR, "$dir/");
@FILES = grep(/.txt/,readdir(DIR));
closedir (DIR);
## Changed this part so that I could get immediate results
foreach $FILES (@FILES) {
if (-e "$dir/$FILES") {
unlink("$dir/$FILES");
}
}
On 10/14/04 11:05 AM, in article Cdzbd.899$9f1.268@trndny05, "Paul Lalli"
<mritty@gmail.com> wrote:
> "Scott Hoffman" <scottshane@earthlink.net> wrote in message
> news:BD940C4A.1A04%scottshane@earthlink.net...
>> I am looking for a way to delete files and directories for a form
> button or
>> even a URL: tried this on but errors 500.
>
> please read: perldoc -q 500
>
>> Is what I want possible??? If so please elaborate.. TIA
>
> Of course it is. Provided, of course, that you have the correct
> permissions to delete files. And by 'you', in this case, I probably
> mean "the application executing your CGI script."
>
>
>> #!/usr/bin/perl
>>
>> ## SPECIFY THE PATH TO THE DIRECTORY
>> ## NOTE: NO TRAILING SLASH "/"
>>
>> $dir = "/Library/Webserver/Documents/unlink_text" ;
>>
>> ## OPEN AND READ THE DIRECTORY
>>
>> opendir (DIR, "$dir/");
>> @FILES = grep(/.txt/,readdir(DIR));
>> closedir (DIR);
>>
>> ## DELETE THE .TXT FILES THAT ARE OLDER THAN 1 DAY
>>
>> foreach $FILES (@FILES) {
>> if (-M "$dir/$FILES" > 1) {
>> unlink("$dir/$FILES");
>> }
>> }
>
> I'd think you can combine all this....
>
> unlink ( grep { /.txt/ && -M "$dir/$_" > 1} readdir DIR);
>
> If perldoc -q 500 doesn't help you figure out your problem, post a short
> BUT COMPLETE script that illustrates your problem.
>
> Paul Lalli
>
>
>
------------------------------
Date: Thu, 14 Oct 2004 19:39:46 GMT
From: Scott Hoffman <scottshane@earthlink.net>
Subject: Re: Unlink Question
Message-Id: <BD9423E7.249C%scottshane@earthlink.net>
Thanks Paul --
OK I checked out the perldoc. Found that I needed
"Content-type: text/html\n\n";
I executed it from the Terminal - work fine
Back to the browser - No error but no results either
Changed the Permissions to from 755 to 777 (I know, I know)
As the previous post indicated a possible permissions issue but still no
results.
This is the exact script that I ran through perl with success::
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$dir = "/Library/Webserver/Documents/unlink_text" ;
opendir (DIR, "$dir/");
@FILES = grep(/.txt/,readdir(DIR));
closedir (DIR);
## Changed this part so that I could get immediate results
foreach $FILES (@FILES) {
if (-e "$dir/$FILES") {
unlink("$dir/$FILES");
}
}
On 10/14/04 11:05 AM, in article Cdzbd.899$9f1.268@trndny05, "Paul Lalli"
<mritty@gmail.com> wrote:
> "Scott Hoffman" <scottshane@earthlink.net> wrote in message
> news:BD940C4A.1A04%scottshane@earthlink.net...
>> I am looking for a way to delete files and directories for a form
> button or
>> even a URL: tried this on but errors 500.
>
> please read: perldoc -q 500
>
>> Is what I want possible??? If so please elaborate.. TIA
>
> Of course it is. Provided, of course, that you have the correct
> permissions to delete files. And by 'you', in this case, I probably
> mean "the application executing your CGI script."
>
>
>> #!/usr/bin/perl
>>
>> ## SPECIFY THE PATH TO THE DIRECTORY
>> ## NOTE: NO TRAILING SLASH "/"
>>
>> $dir = "/Library/Webserver/Documents/unlink_text" ;
>>
>> ## OPEN AND READ THE DIRECTORY
>>
>> opendir (DIR, "$dir/");
>> @FILES = grep(/.txt/,readdir(DIR));
>> closedir (DIR);
>>
>> ## DELETE THE .TXT FILES THAT ARE OLDER THAN 1 DAY
>>
>> foreach $FILES (@FILES) {
>> if (-M "$dir/$FILES" > 1) {
>> unlink("$dir/$FILES");
>> }
>> }
>
> I'd think you can combine all this....
>
> unlink ( grep { /.txt/ && -M "$dir/$_" > 1} readdir DIR);
>
> If perldoc -q 500 doesn't help you figure out your problem, post a short
> BUT COMPLETE script that illustrates your problem.
>
> Paul Lalli
>
>
>
------------------------------
Date: Thu, 14 Oct 2004 21:38:06 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Unlink Question
Message-Id: <ckmnqu$68m$1@sun3.bham.ac.uk>
Scott Hoffman rudely vomits TOFU in our faces:
> On 10/14/04 11:05 AM, in article Cdzbd.899$9f1.268@trndny05, "Paul Lalli"
> <mritty@gmail.com> wrote:
>
>>"Scott Hoffman" <scottshane@earthlink.net> wrote in message
>>news:BD940C4A.1A04%scottshane@earthlink.net...
>>
>>>even a URL: tried this on but errors 500.
>>
>>please read: perldoc -q 500
>>If perldoc -q 500 doesn't help you figure out your problem, post a short
>>BUT COMPLETE script that illustrates your problem.
>>
> > Thanks Paul --
> OK I checked out the perldoc. Found that I needed
> "Content-type: text/html\n\n";
>
> I executed it from the Terminal - work fine
>
> Back to the browser - No error but no results either
Perhaps it would be would be a good idea to modify your program so that
it prints out the reason if the unlink fails.
------------------------------
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 7251
***************************************