[12488] in Perl-Users-Digest
Perl-Users Digest, Issue: 6088 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 22 08:07:19 1999
Date: Tue, 22 Jun 99 05:00:19 -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 Jun 1999 Volume: 8 Number: 6088
Today's topics:
Re: 2 simple (not to me tho) questions (Casey R Tweten)
Re: aarrggghhh opening a file... (Casey R Tweten)
Apache + Perl ivanwalsh@my-deja.com
Re: Beginner Perl Question <ppjohn@ncs.com.sg>
Re: Beginner Perl Question <ppjohn@ncs.com.sg>
Re: bulk emailing <anfi@bigfoot.com>
Re: can you split a word into letters? kkostenbader@my-deja.com
floundering with fork.... <wavey@pilot.infi.net>
Re: hello looking for script <bogart@exis.net>
Re: how to test pl scripts.? ivanwalsh@my-deja.com
Re: HTML Redirection (Casey R Tweten)
Re: Interpreting MS-ASCII - anyone have a filter? <flavell@mail.cern.ch>
Re: Language choice for high-volume Oracle CGI interfac <matt.sergeant@ericsson.com>
mod_perl and resources <kamk@email.cz-remove-this->
Re: mod_perl references <matt.sergeant@ericsson.com>
Re: Newbie:VBQ (Very Basic Question) <ppjohn@ncs.com.sg>
Re: NON-BACK Help needed <gellyfish@gellyfish.com>
Re: Obtaining values from a file (Kvan)
Re: Safe expression evaluation <tchrist@mox.perl.com>
Searching for RegEx in binary files <Rutzmoser@SANIX.de>
Re: Statistics for comp.lang.perl.misc (Bart Lateur)
uploading by browser <mark.stellaard@knoware.nl>
Re: uploading by browser <gellyfish@gellyfish.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 22 Jun 1999 09:27:05 GMT
From: crt@highvision.com (Casey R Tweten)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <376f5681.641909974@news.kiski.net>
On Mon, 21 Jun 1999 22:45:49 -0700, lr@hpl.hp.com (Larry Rosler) wrote:
:If shorter is better...
:
:my@animal=qw(c a t);
:print@animal;
print "cat";
sounds like he wants to store the string as an array anyway, for most
cases there is no need.
This is kinda fun...
--
Casey Tweten HighVision Associates
Web Developer http://www.highvision.com
<joke> This is 100% certified,
virus and bug free code </joke>
------------------------------
Date: Tue, 22 Jun 1999 09:22:55 GMT
From: crt@highvision.com (Casey R Tweten)
Subject: Re: aarrggghhh opening a file...
Message-Id: <376f5542.641590913@news.kiski.net>
On Mon, 21 Jun 1999 17:47:00 +0200, "Oreg Dixie" <maistro@swi.hu> wrote:
:Hi!
:
:I'm trying to open a file like this:
:
:$forumfile = param("forumfile"); #form's textfield
:
:open(IDOUT, ">$forumfile");
:.
:.
:.
:close(IDOUT);
:
:But it stops at the open, don't want to create the file and the browser
:didn't display the whole CGI...
OK dude, as I have learned in the past, you must do your error checking
before posting something like this here.
open IDOUT, ">$forumfile" || die "Couldn't open: $!";
test from comand line
shebang (may/should) include -w
This should help you determine your problem more clearly, then perhaps
we can help you with your problem better.
--
Casey Tweten HighVision Associates
Web Developer http://www.highvision.com
<joke> This is 100% certified,
virus and bug free code </joke>
------------------------------
Date: Tue, 22 Jun 1999 09:02:43 GMT
From: ivanwalsh@my-deja.com
Subject: Apache + Perl
Message-Id: <7knjfh$3vm$1@nnrp1.deja.com>
Hello All,
**newbie - please be patient **
I want to test Perl on my Win98 workstation at home and have read that
I can use ActivePerl for the Perl installation and Apache for the
server site.
My question is, will setting up Apache on my workstation effect Windows
on any way. In other words can they both be installed on the same
machine without destroying each other.
Regards
Ivan
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 22 Jun 1999 18:00:00 +0800
From: John Paopeng <ppjohn@ncs.com.sg>
To: Howie <noone@home.com>
Subject: Re: Beginner Perl Question
Message-Id: <376F5EA0.82771B11@ncs.com.sg>
Howie wrote:
>
> Is it possible to execute a script every 2 hours ( I need to delete cached
> files) using Perl or a CGI script? Or would I have to use a complete different
> language?
> thanks
if you run it under Unix, you can use the system call "date"
$_ = `date`;
The result of "date" command will be assigned to special variable $_
and from here you can just use string matching...etc.. to manipulate the
string $_
>From there you will get the time and make you program do some task every
2 hours.
Hope this help.
John
--
=========================================================================
mailto:ppjohn@ncs.com.sg
PGP key: http://www.nai.com/products/security/public_keys/lookup_key.asp
Home page: http://www.geocities.com/TheTropics/Island/5251/
==========================================================================
------------------------------
Date: Tue, 22 Jun 1999 18:02:48 +0800
From: John Paopeng <ppjohn@ncs.com.sg>
To: Howie <noone@home.com>
Subject: Re: Beginner Perl Question
Message-Id: <376F5F48.FEC83E6@ncs.com.sg>
Howie wrote:
>
> Is it possible to execute a script every 2 hours ( I need to delete cached
> files) using Perl or a CGI script? Or would I have to use a complete different
> language?
> thanks
if you run it under Unix, you can use the system call "date"
$_ = `date`;
The result of "date" command will be assigned to special variable $_
and from here you can just use string matching...etc.. to manipulate the
string $_
>From there you will get the time and make you program do some task every
2 hours.
Hope this help.
John
--
=========================================================================
mailto:ppjohn@ncs.com.sg
PGP key: http://www.nai.com/products/security/public_keys/lookup_key.asp
Home page: http://www.geocities.com/TheTropics/Island/5251/
==========================================================================
------------------------------
Date: Tue, 22 Jun 1999 12:29:08 +0200
From: Andrzej Filip <anfi@bigfoot.com>
To: Dani Koesterich <mrdank@sprintmail.com>
Subject: Re: bulk emailing
Message-Id: <376F6574.1BFBD40A@bigfoot.com>
Change
open(MAIL,"|$mailprog -t")
to
open( MAIL"$mailprog -t -oi -odd")
-oi - single dot is not end of message
-odd - deferred delivery - put in queue DNS lookups later
-odd is strictly necessary for such bulk mailing - sendmail will not
try to deliver messages "at once" so you will not bring it to its knees.
if your sendmail does not support -odd try -odq
Dani Koesterich wrote:
> I created a script that takes an email database file, and a message file and
> sends the message to each person in the email database file. I have over
> 10,000 emails in my database and growing (it is a newsletter) and it gave me
> an error after email #950 so I figured it was because I wasn't letting my
> server rest, so I made the script pause for 3 minutes every 200 emails and
> started from email #951. It did 200 emails and paused for 3 minutes, then
> gave me an error after email #237 and a friend of mine suggested that it was
> because the email address in use had an invalid host or something.... I have
> attached the script to the end of this message, and if anyone could tell me
> how to make sure the email address works before sending out the mail, I
> would be very appreciative. Thank You.
>
> #!/usr/local/bin/perl -w
>
> require "cgi-lib.pl";
> [...]
> $mailprog = '/usr/sbin/sendmail';
> [...]
> open(MAIL,"|$mailprog -t");
--
Andrzej (Andrew) A. Filip
mailto:anfi@bigfoot.com http://www.bigfoot.com/~anfi
Postings: http://www.deja.com/profile.xp?author=Andrzej%20Filip&ST=PS
fax: +1(801)327-6278
------------------------------
Date: Tue, 22 Jun 1999 09:59:49 GMT
From: kkostenbader@my-deja.com
Subject: Re: can you split a word into letters?
Message-Id: <7knmqi$4te$1@nnrp1.deja.com>
Try this:
@letters = split(//, $word);
$firstletter = $letters[0];
In article <slrn7mrfec.k1b.abigail@alexandra.delanet.com>,
abigail@delanet.com wrote:
> Weborium (weborium@aol.com) wrote on MMCXX September MCMXCIII in
> <URL:news:19990620225849.01980.00001937@ng-cc1.aol.com>:
> ;;
> ;; Since a single word doesn't have any delimiter, is there a way to
split it up
> ;; into letters, or pull out a single letter?
> ;; I'm trying to take the first letter off a word and store it in a
variable.
>
> sub pohc (@) {
> my $r;
> foreach my $s (@_ ?
> @_ :
> $_) {
> $s = reverse $s;
> $r = chop $s;
> $s = reverse $s;
> }
> $r;
> }
>
> my $your_word = "foobar";
> my $first_letter = pohc $your_word;
>
> Abigail
> --
> perl5.004 -wMMath::BigInt
-e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
>
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$
%$^W]
>
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+c
hr$^V
> %$^U;$^V/=$^U}while$^V!=$^W'
>
> -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
> http://www.newsfeeds.com The Largest Usenet Servers in the
World!
> ------== Over 73,000 Newsgroups - Including Dedicated Binaries
Servers ==-----
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 22 Jun 1999 07:08:03 -0400
From: Dave <wavey@pilot.infi.net>
Subject: floundering with fork....
Message-Id: <376F6E93.2CB603FF@pilot.infi.net>
disclaimer: I'm new to perl :-)
I am grepping from a large text file for use later in my script. Is
it possile to have a forked child take care of the grep while the parent
goes on to sub menu which has a few options any of which need the
@grepped_text from the child? How do I get the array from child to sub
whatever?
In other words I want this time consuming grep to run while a user is
reading and selecting options. After a few options the sub that they
end up in will need to do some work on that grepped array.....
Am I thinking about this fork in the wrong way?
Thank you in advance!!
------------------------------
Date: Tue, 22 Jun 1999 07:21:23 -0500
From: Ed Bogart <bogart@exis.net>
Subject: Re: hello looking for script
Message-Id: <376F7FC3.932DD7F4@exis.net>
Thanks for the request P. I can always count on CLPM to start my day with a laugh!
P-aCMa-N@webtv.net wrote:
>
> theres a script that lets you Upload to any server that has ftp access
> to your account on that server. theres places called TransLoader and
> FreeLoader. can someone please find this fo rme. i need it and im on
> webtv which is a needed thing. heres one of the addys.
> http://transload.starblvd.net i dont know if u can view the page but if
> u need more info please post or email me. thannx :^)
------------------------------
Date: Tue, 22 Jun 1999 08:58:37 GMT
From: ivanwalsh@my-deja.com
Subject: Re: how to test pl scripts.?
Message-Id: <7knj7p$3to$1@nnrp1.deja.com>
Forgive this question (we all begin somewhere)
but if I want to install Linux or Apache, do I
have to uninstall Windows 98. Somehow I was under
the impression that you could not have Win98 and
Linux on the same workstation.
My aim being also to test Perl files.
thanks
Ivan
> Why not test on your PC? The best route would
be to install Linux on> your PC, but if there's a
reason why you don't want to do that you can
> get Apache and Perl for Win32 and you'll have a
pretty good test bed.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 22 Jun 1999 09:35:17 GMT
From: crt@highvision.com (Casey R Tweten)
Subject: Re: HTML Redirection
Message-Id: <376f57db.642256202@news.kiski.net>
On Tue, 22 Jun 1999 00:28:53 GMT, bandhunt@my-deja.com wrote:
:I was hoping someone could tell me how to
:redirect HTML using Perl/CGI.
:
:I have a search script for my website and instead
:of displaying a list of matches using
:Content-type: text/html\n\n" to print out the
:HTML output, I want the script to take the user
:directly to a specific URL based on the search
:query.
:
:Any help would be great.
Well.... If you are using the always cool CGI.pm way to do things, then
you must check out the superb documentation for that module, a wonderful
one line redirect there....
In fact, since it is early, I'll give you this section in the docs.
====================
GENERATING A REDIRECTION HEADER
print $query->redirect('http://somewhere.else/in/movie/land');
Sometimes you don't want to produce a document yourself, but simply
redirect the browser elsewhere, perhaps choosing a URL based on the time
of day or the identity of the user.
The redirect() function redirects the browser to a different URL. If you
use redirection like this, you should not print out a header as well. As
of version 2.0, we produce both the unofficial Location: header and the
official URI: header. This should satisfy most servers and browsers.
One hint I can offer is that relative links may not work correctly when
you generate a redirection to another document on your site. This is due
to a well-intentioned optimization that some servers use. The solution
to this is to use the full URL (including the http: part) of the
document you are redirecting to.
You can also use named arguments:
print $query->redirect(-uri=>'http://somewhere.else/in/movie/land',
-nph=>1);
The -nph parameter, if set to a true value, will issue the correct
headers to work with a NPH (no-parse-header) script. This is important
to use with certain servers, such as Microsoft Internet Explorer, which
expect all their scripts to be NPH.
====================
If not, then you are of course asking an html question hoping to pass it
off on us as a Perl question simply because you will be putting quotes
around it and telling the interpreter to print. In which case, you are
in for it.
--
Casey Tweten HighVision Associates
Web Developer http://www.highvision.com
<joke> This is 100% certified,
virus and bug free code </joke>
------------------------------
Date: Tue, 22 Jun 1999 13:22:38 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Interpreting MS-ASCII - anyone have a filter?
Message-Id: <Pine.HPP.3.95a.990622125100.21625G-100000@hpplus03.cern.ch>
On Tue, 22 Jun 1999, Bart Lateur wrote:
> I didn't say that. I said that Windows uses a superset of the standard
> that many Unices use.
This thread now seems to have gone totally adrift.
My original statement was:
MS have a tendency to refer to their 8-bit codings as "ANSI", but I've
never found anything from the ANSI that justifies this usage,
You gave an impression of wanting to argue with that, but now that
you've clarified several misinterpretations of what you were claiming,
it appears that you haven't addressed that issue at all, but have merely
reiterated what everyone knows, that MS-Windows code is similar to
iso-8859-1 but differs in as much as it assigns printable characters in
the range 128-159 decimal. And that some people wave the term "Ansi"
or "ANSI" around loosely to refer to some 8-bit code or other,
regardless of the fact that nobody can point to an ANSI specification
that justifies this usage.
If we look at the IANA character set registrations, e.g at
http://www.isi.edu/in-notes/iana/assignments/character-sets , the term
"ANSI" appears just three times: ANSI_X3.4-1968 and ANSI_X3.4-1986,
which are the 7-bit code generally known as US-ASCII (ISO-IR-6), and
ANSI_X3.110 1983, which is an 8-bit videotext standard code also known
as ISO-IR-99, and documented for example here:
ftp://dkuug.dk/i18n/WG15-collection/charmaps/ANSI_X3.110-1983 , which
definitely isn't iso-8859-1.
Instead, it seems you are now claiming that the term "Ansi" is an alias
of iso-8859-1, which is an entirely new claim to me, and one that I
don't want to get involved in.
So we see the importance of precision when talking about character
codings. Any other way lies madness.
'bye
------------------------------
Date: Tue, 22 Jun 1999 10:14:15 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Language choice for high-volume Oracle CGI interface?
Message-Id: <376F53E7.14B9AFC3@ericsson.com>
Lee Fesperman wrote:
>
> Actually, there are a lot of disadvantages to using a 'subset' of a language for
> specific purpose (like using a subset of Perl for CGI). Assuming you're advocating using
> a subset of Perl (so you don't have to learn the full blown language), the disadvantages
> of that approach include:
>
> + You must clearly document this subset, carefully leaving out complexities of the
> language that are not needed. What to include can be a very hard choice to make.
Why?
> + To a user of the subset, many of the elements will be counter-intuitive since they
> were actually designed for a larger purpose.
Such as? Please give examples, with comparisons to how Jive does this so
much better. Don't limit yourself to pure perl, but consider things like
EmbPerl which do something very similar to Jive (without it's
limitations).
> + Certain aspects of the processing will always be a 'misfit' (impediance mismatch) with
> the language. For instance, access to CGI variables in Perl always requires an explicit
> lookup. These aspects will never make 'sense' to the subset user.
Eh? With Jive you declare:
input my_form_name
With perl you generally do:
param('my_form_name') - CGI.pm
or with EmbPerl:
$fdat{my_form_name}
No explicit lookup. Those seem like perfect matches to me.
> If you are recommending that Perl CGI is a good choice for an experienced developer in
> Perl, I wholeheartedly agree with you.
s/ in Perl//;
My experience with languages limited to one problem domain is that they
are just that: Limited.
Matt.
------------------------------
Date: Tue, 22 Jun 1999 11:26:26 +0200
From: "Kamil Kukura" <kamk@email.cz-remove-this->
Subject: mod_perl and resources
Message-Id: <7knl0n$ga5$1@adis.cesnet.cz>
Anyone using mod_perl with Apache? To me it seems that every httpd process
is running perl interpreter so that it eats a lot of resources.
Kamil
------------------------------
Date: Tue, 22 Jun 1999 10:24:13 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: mod_perl references
Message-Id: <376F563D.98887FCD@ericsson.com>
Donny Widjaja wrote:
>
> Hi,
>
> I am planning to use mod_perl to speed up my CGI scripts and save some
> memory. ^^^^^^^^^
^^^^^^
Don't expect that.
Matt.
------------------------------
Date: Tue, 22 Jun 1999 17:49:10 +0800
From: John Paopeng <ppjohn@ncs.com.sg>
To: "Stuart, Xinlu and Niuniu" <stannehi@tu.infi.net>
Subject: Re: Newbie:VBQ (Very Basic Question)
Message-Id: <376F5C16.548747A6@ncs.com.sg>
Stuart, Xinlu and Niuniu wrote:
>
> I just purchased a book "Perl 5 By Example" that came with perl5 on a
> cd. I installed it, it appears to be working. I typed print("blah blah
> blah ,\n"); in notepad and named it test.pl
> Tried to run it and nothing happened. I know this is beyond basic but I
> would appreciate any help I could get. I am doing all of this in the
> windows98 environment (if that even matters)
>
> -Stuart
Hi
Have to add PATH correctly???
Try this $perl -v
if it print out something, that mean your PATH has been added correctly.
John
--
=========================================================================
mailto:ppjohn@ncs.com.sg
PGP key: http://www.nai.com/products/security/public_keys/lookup_key.asp
Home page: http://www.geocities.com/TheTropics/Island/5251/
==========================================================================
------------------------------
Date: 22 Jun 1999 10:05:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NON-BACK Help needed
Message-Id: <376f51ef@newsread3.dircon.co.uk>
Tim <bie@connect.ab.ca> wrote:
> Hello,
>
> I am making a game & I want to be able to stop the user from simply
> pushing back on their
> browser and trying again. How can I do this?
>
Cut the wire on their mouse.
How you might do this however is not a Perl question and should be taken
up with a more appropriate group ...
/J\
--
"What is the future for beef? Curtains?" - Graham Norton
------------------------------
Date: Tue, 22 Jun 1999 08:51:43 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: Obtaining values from a file
Message-Id: <376f4d4e.65364959@news.newsguy.com>
On Tue, 22 Jun 1999 17:41:35 +1000, Derek Lavine
<derek@realware.com.au> wrote:
>P.S. I am quite new to perl so please keep expliantions simple and don't
>assume I know to much about reg expressions, thanks again.
Well, you should definitely read up on regexen--you'll be using them a
LOT.
Anyhow, the regex you want here is:
/%%(\w+)%%="([^"]*?)"/
This would put the variable name into $1 and the value into $2.
Note also that you cannot have two hash values with the same key. If
you store something in $hash{"var3"} and the store something else in
$hash{"var3"}, the first value will disappear.
Your task, therefore, involves creating a loop to read the file, and
then find some way of making unique names for each variable. Maybe
you'll want to be able to infer the original name from the unique
one--that depends on your application's needs.
What you should do is try to code the thing (remember to use -w and
use strict), and then, when you run into a problem you can't solve,
post the relevent part of the code and ask for help.
Kvan.
-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- | dumb, panicky, dangerous animals
| and you know it.'
| - "K" in Men in Black.
------------------------------
Date: 22 Jun 1999 05:56:18 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Safe expression evaluation
Message-Id: <376f79e2@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"Marcel van der Laan" <Marcel.vdLaan@ehv.sc.philips.com> writes:
:I'd like to, but the whole mox.perl.com site seems to be down, from where
:I'm at. Is it mirrored anywhere?
Please try again.
--tom
--
"Unix has its weak points, but its file system is not one of them." -Chris Torek
------------------------------
Date: Tue, 22 Jun 1999 09:37:49 GMT
From: Rutzmoser Stefan <Rutzmoser@SANIX.de>
Subject: Searching for RegEx in binary files
Message-Id: <7knlhd$4j4$1@nnrp1.deja.com>
Hello everyone,
I have binary files with strings in it. The strings I'm searching for
are a versioninfo. I want them to read them out of these files with
perl. There are two different patterns for:
$ProgPattern = q/\[BBS-PVERS\] (\S*) *(\d{3})\/(\d\d)\.?(\d\d)\.?(\d
{2,4}) Rel:(\d{6,8})/;
$COPYPattern = q/\[BBS-CVERS\] (\S*) *(\d{3})\/(\d\d)\.?(\d\d)\.?(\d
{2,4}) Rel:(\d{6,8})/;
The relevant lines of code are:
open(FILE,"<$filename");
binmode FILE;
@File = <FILE>;
close(FILE);
foreach(@File)
{
/$ProgPattern/ && do { ... printsomething ... };
/$COPYPattern/ && do { ... printsomething ... };
}
The ProgPattern matches once (ok). The COPY-Pattern matches also once.
This is false, because there ARE more than one String like this in the
given file. There is only the first one found.
What can I do to find all matches?
Thanks a lot.
Stefan
--
Rutzmoser@SANIX.de
http://www.sanix.de
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 22 Jun 1999 11:48:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <377077b3.4718606@news.skynet.be>
Greg Bacon wrote:
>: Abigails quoting starts with one of:
>:
>: * 2 identical non-word characters (but not space)
>: * a set of matching "parens", such as "()","<>","[]","{}"
>: * Two capital i's. I've seen this only once, and honestly, I think this
>: was a mistake.
>
>The third came about as a way of showing that she would be able to
>beat even something like /^[[:ispunct:]{2}/. It's just a heuristic.
>It's not always going to work, but it's good enough for most cases.
>If someone is sufficiently determined to appear to have a high OCR,
>then there really isn't much I can do to stop him. No, I'm not going
>to sit and do it by hand. :-)
OK. It looks like Abigail can select the quoting prefix by hand for
every single post. However, I do think that there's a very general
approach, that should work for whatever she's going to invent next. Here
it is:
* Do OCR check as usual. If it looks like somebody has a suspiciously
high OCR ratio, it either must be Abigail, or somebody trying to imitate
her. In that case:
* Check the most frequent occuring prefix in one post, excluding
whitespace. Something like:
while(/^(\S\S)/gm) {
$prefix{$1}++;
}
* The number of quoted lines is the highest value in values %prefix. Or,
sort keys %prefix acooording to value, and pick the last item.
The only way to beat that, is to use more than one quoting prefix in one
post, which *definitely* is bad Usenet prectise, and qhould be frowned
upon, as it will no longer be easily identifiable as quoting, for the
human reader, also.
Let's see:
#! perl -w
$_ = do { local $/; <DATA> };
s/^-- *\n.*//ms;
print;
while(/^(\S\S)/gm) {
$prefix{$1}++;
}
$quoted = max(values %prefix);
print "Quoted lines: $quoted\n";
sub max {
my $max = shift;
while(@_) {
my $value = shift;
$max = $value if $max<$value;
}
$max;
}
$last = (sort { $prefix{$a} <=> $prefix{$b} } keys %prefix)[-1];
print "Quoting: \"\Q$last\E\"; lines: $prefix{$last}\n";
__DATA__
Bart Lateur (bart.lateur@skynet.be) wrote on MMCXX September MCMXCIII in
<URL:news:376e9cd7.236836@news.skynet.be>:
II
II Abigails quoting starts with one of:
II
II * 2 identical non-word characters (but not space)
II * a set of matching "parens", such as "()","<>","[]","{}"
II * Two capital i's. I've seen this only once, and honestly, I think
this
II was a mistake.
Do you really think I make mistakes like that?
Abigail
--
perl -MTime::JulianDay
-lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
__END__
Quoted lines: 7
Quoting: "II"; lines: 7
p.s. Posts like TomC's, with a lot of precanned or literal parts from
the POD files, can hardly be considered "original". Nevertheless, they
beat all quoting detection heuristics.
Bart.
------------------------------
Date: Tue, 22 Jun 1999 10:59:44 +0200
From: "Mark Stellaard" <mark.stellaard@knoware.nl>
Subject: uploading by browser
Message-Id: <7knj42$7c1$1@tasmania.dev.ict.nl>
Hello everybody,
I want to write a perl program which is able to let users upload word
document's to a Unix server in a specific directory tru a webbrowser. Is
this possible ?
And if so, can somebody tell me what modules I have to use, and how this can
be done easily, or if there is any information about this specific topic.
Thanx a lot :-)
Mark
------------------------------
Date: 22 Jun 1999 10:18:26 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: uploading by browser
Message-Id: <376f54e2@newsread3.dircon.co.uk>
Mark Stellaard <mark.stellaard@knoware.nl> wrote:
> Hello everybody,
>
> I want to write a perl program which is able to let users upload word
> document's to a Unix server in a specific directory tru a webbrowser. Is
> this possible ?
> And if so, can somebody tell me what modules I have to use, and how this can
> be done easily, or if there is any information about this specific topic.
>
Please check out Brent Michalski's article on this at :
<http://webreview.com/wr/pub/98/08/14/perl/index.html>
/J\
--
"Most big companies don't like you very much, except hotels, airlines
and Microsoft, which don't like you at all" - Bill Bryson
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6088
**************************************