[16418] in Perl-Users-Digest
Perl-Users Digest, Issue: 3830 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 28 06:05:25 2000
Date: Fri, 28 Jul 2000 03:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964778712-v9-i3830@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 28 Jul 2000 Volume: 9 Number: 3830
Today's topics:
A challenge involving auto page creation: cgi or asp or <alexwalker@hotmail.com>
Re: autoresponder with customised message <gellyfish@gellyfish.com>
Compile XS Files for WinNT <steve.jones@takethisoutproact.net>
Compile XS Files for WinNT <steve.jones@takethisoutproact.net>
Re: Critiques, please (Villy Kruse)
Re: Critiques, please <bart.lateur@skynet.be>
database alternative <Seb.Erlhofer@evc.net>
Re: Delete records in 2 weeks time <jaurangNOjaSPAM@crosswinds.net.invalid>
Re: Do I Need Chomp? <was Critiques, please> <bart.lateur@skynet.be>
download file from another server <Seb.Erlhofer@evc.net>
Re: Generate XML then convert to HTML using XSLT in Per <matt@sergeant.org>
Re: Help! <gellyfish@gellyfish.com>
Re: Is this a bogus -w warning? <bart.lateur@skynet.be>
Re: Making and extracting from XML-like string <bart.lateur@skynet.be>
Re: MTA/POP3 server in Perl (Abigail)
New Site: www.perlmodules.com <jthomson110@home.com>
Re: New Site: (Abigail)
Re: New Site: (Rafael Garcia-Suarez)
Re: newb Q, Our perl guy left!! <bill.kemp@wire2.com>
Re: nntp client <gellyfish@gellyfish.com>
Re: Nobody loves me? <gellyfish@gellyfish.com>
Re: Perl sequivallent for tidy (HTML fixup program)? <gellyfish@gellyfish.com>
Re: regex email blocker <gellyfish@gellyfish.com>
Re: return value of `eval "use lib"' <bart.lateur@skynet.be>
Re: return value of `eval "use lib"' (Sweth Chandramouli)
Re: Sending email with attachment <gellyfish@gellyfish.com>
Re: shifting strings <bart.lateur@skynet.be>
Re: Should truncate length be 0? <bart.lateur@skynet.be>
ttt <lxzy@yeah.net>
Re: WHOIS not standart query HELP!!! <gellyfish@gellyfish.com>
Re: WWWBoard.PL (Neil Kandalgaonkar)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 Jul 2000 09:47:25 +0100
From: "Alex Walker" <alexwalker@hotmail.com>
Subject: A challenge involving auto page creation: cgi or asp or what?
Message-Id: <vObg5.1461$NJ4.29479@news6-win.server.ntlworld.com>
Dear All,
Firstly I'm sorry if this is off subject but I am a bit stuck and would
appreciate some help!!!
I am in the progress of setting up a web site in England that will provide
free websites to businesses in a certain region as I have always felt that
all businesses, especially small ones should have the right to be
represented on such an important communication medium. What I would like to
have is a sign up form where businesses can apply for thier free site.
However, unlike something like Geocities that provide space I want to create
content based on what they submit. In this form users enter what type of
business (e.g.. agricultural) and their business info along with a name for
their directory.
They will then have the choice of two options:
A - they have a website already, which is found at URL xyz. Consequently the
free page that they create which is found at e.g. www.mysite.com/farmerjo
would redirect the browser to the URL xyz that they specified.
OR
B - they don't have a site. Consequently the free page that they create
which is found at e.g. www.mysite.com/farmerjo has a template which is
specific to their type of business (e.g. green with tractors for
agricultural) and their information that they typed into the form appears on
the page.
I would like to have the new pages that people create recorded to a
database - is this what MySQL is about - what about MS access/how do I
integrate it?
I do not want people to have the ability to alter the content of their sites
at all.
Is all this possible with a cgi script or asp or what?!. Do I need to buy
somethingor is there anybody that will make alteratiosn to free scripts? I
am running the project on a tiny budget so this is why I am writing to you
for assistance.
Thanks in advance,
Regards
Alexander Walker
------------------------------
Date: 28 Jul 2000 09:23:21 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: autoresponder with customised message
Message-Id: <8lrftp$stt$1@orpheus.gellyfish.com>
On Wed, 26 Jul 2000 15:35:16 GMT drdementor@my-deja.com wrote:
>
> I dont want to do run any perl on my pc i want this done on a web
> server, I think that is the better way of doing it.
>
I think a better way of doing it would be to work out exactly what it is
that you want to do and then work out what you need to find out and where
you need to find it out from.
The majority of what you need to know will have nothing to do with Perl and
should be asked somewhere else - I dont think anyone here is going to give
a beginners tutorial on internet mail any time real soon now.
When you have worked out what part Perl will play in this and if you are
having trouble with some specific code then do come back and ask.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Thu, 27 Jul 2000 16:56:59 +0100
From: "Steve Jones" <steve.jones@takethisoutproact.net>
Subject: Compile XS Files for WinNT
Message-Id: <39813f67_1@nnrp1.news.uk.psi.net>
I have installed nsPerl. I want to use MIMETools to parse and extract an
attachment from an email, but I can't compile/install or otherwise deal with
the package. What is an XS files, do I need a C compiler and, if so, which?
Why does make say 'no target' etc.
It's as if I only have half the stuff I need.
--
Steve Jones
ProAct International, 9a Vale Street, Denbigh, North Wales
01745 813 586
stevej@proact.net
------------------------------
Date: Thu, 27 Jul 2000 16:56:59 +0100
From: "Steve Jones" <steve.jones@takethisoutproact.net>
Subject: Compile XS Files for WinNT
Message-Id: <39814d33_2@nnrp1.news.uk.psi.net>
I have installed nsPerl. I want to use MIMETools to parse and extract an
attachment from an email, but I can't compile/install or otherwise deal with
the package. What is an XS files, do I need a C compiler and, if so, which?
Why does make say 'no target' etc.
It's as if I only have half the stuff I need.
--
Steve Jones
ProAct International, 9a Vale Street, Denbigh, North Wales
01745 813 586
stevej@proact.net
------------------------------
Date: 28 Jul 2000 08:23:43 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Critiques, please
Message-Id: <slrn8o2gof.8b7.vek@pharmnl.ohout.pharmapartners.nl>
On Thu, 27 Jul 2000 23:13:28 GMT, Tim Hammerquist <tim@degree.ath.cx> wrote:
>
>To my (oft-twisted) mind, rewind() makes the most sense when applied to
>files. Files (like most tapes) have a beginning and an end. Disk-drives
>have no physical end or beginning; just dimensions.
>
However, seek also makes sense because you can seek to any file position.
OK, I think there are no good arguments to prefer one word to the other
when setting the file point er back to the start of the file.
Villy
------------------------------
Date: Fri, 28 Jul 2000 09:15:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Critiques, please
Message-Id: <mhj2osclqlnvg3f0529ikajk45lqq1jrde@4ax.com>
["seek" vs. "rewind"]
Tim Hammerquist wrote:
>Villy Kruse wrote:
>
>> Which word makes most sence. Seek is comething you do to a disk unit
>> to locate the heads on a certain cylinder. Rewind is what you do
>> to a reel of tape.
>>
>> Villy
>
>To my (oft-twisted) mind, rewind() makes the most sense when applied to
>files. Files (like most tapes) have a beginning and an end. Disk-drives
>have no physical end or beginning; just dimensions.
Hmm... "rewind to the end of the file" doesn't sound well. IMO, "rewind"
means going back to the start.
If you're going to the start of the file, you might just as well call it
"rewind". "seek" is going to any randomly selected position. So Perl's
seek() function does indeed have the most universal name. To me, the
equivalence is:
rewind FILE;
=
seek FILE, 0, 0;
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 10:59:58 +0200
From: Sebastian Erlhofer <Seb.Erlhofer@evc.net>
Subject: database alternative
Message-Id: <2ri2os8mg9f80l7calbd7va07rf8g04joq@4ax.com>
On 27 Jul 2000 17:55:11 EDT, abigail@foad.org (Abigail) wrote:
>Sebastian Erlhofer (Seb.Erlhofer@evc.net) wrote on MMDXXII September
>MCMXCIII in <URL:news:df61oss20jc6d65qqcnr1vnjdikq4td37i@4ax.com>:
>??
>?? >?? >And your Perl question is?
>?? >??
>?? >?? Is: What alternatives gives me perl except flatfile-format! :)
>?? >
>?? >
>?? >About any database you can imagine. But that doesn't solve your problem,
>?? >now does it?
>?? >
>?? >
>?? >Abigail
>??
>?? Well, as I said... I cannot create a database with prompt command...
>?? and my question, dear ABIGAIL, was: how can I OR what alternatives are
>?? there...
... there which I can use with perl...
Abi... just getting a bit old these days and a bit hard in
understanding? :)
Seb
------------------------------
Date: Fri, 28 Jul 2000 00:15:18 -0700
From: Taurean <jaurangNOjaSPAM@crosswinds.net.invalid>
Subject: Re: Delete records in 2 weeks time
Message-Id: <12b1ef48.ef301a29@usw-ex0108-061.remarq.com>
Thanks for your reply. I will try it. At least deja allows
searching, not like Alta Vista. Btw who is the publisher of
the book?
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: Fri, 28 Jul 2000 09:28:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Do I Need Chomp? <was Critiques, please>
Message-Id: <r7k2oskf294sm4jsgmgkssoqrmcgsp3uth@4ax.com>
BUCK NAKED1 wrote:
>a matter of taste or opinion... similar to those who contested Abigail's
>order of using print before truncate?
print() immediately followed by truncate() sometimes doesn't work. I've
had cases (i.e. certain Perl executables) where it failed. I think that,
to be on the safe side, you need to do a seek() before doing a
truncate().
I once filed a bug report on ActiveState on a similar case, where a read
followed by a print in a RW file didn't work. The reply was that the
docs for the C library did not garantee that it should work, so that it
wasn't even considered a bug. I needed to do a seek() before switching
from reading to printing. I bet they'd say the same thing in this case.
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 11:04:07 +0200
From: Sebastian Erlhofer <Seb.Erlhofer@evc.net>
Subject: download file from another server
Message-Id: <dvi2osg7ulvq8re4sess4cqj82vrk8futs@4ax.com>
>does the job you want, this group needs more info. about
>the problem space.
no prob...
The script has to work as follows:
User click at button (call script)
Script has to download file, lets say from "www.minehost.com/abc.zip"
Script has to save file to "www.minehostmirror.com/abc.zip"
Giving report...
That's what it should do.
I am newbie, so if you have time, it would be nice if you would answer
"more complex" :))
Tnx!
Seb
------------------------------
Date: Fri, 28 Jul 2000 10:03:24 +0100
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: Generate XML then convert to HTML using XSLT in Perl
Message-Id: <39814C5C.12E9E4D@sergeant.org>
Phil Ursted wrote:
>
> I took a brief look at this, but it seems to be geared towards more
> static XML files which have stylesheets applied to them dynamically, or
> pages with snippets of code (XSP with Perl) embedded in them.
>
> What I was hoping to do was have the CGI generate the XML dynamically
> based on user input to a form, then apply one of several XSL transforms
> to the result to produce HTML. i.e. there is no pre-existing XML file,
> just the CGI.
>
> Is there a clean way to use AxKit from Apache::Registry, since they are
> both based on mod_perl ? Or should I think about rewriting completely or
> using something else?
You could use XML::Sablotron stand alone as-is, by generating your own XML,
but in AxKit's terms, the XSP is not just "snippets of code" - it _is_ the
CGI. And it has direct access to a $cgi object (on which you can call
$cgi->param()...) based on libapreq.
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org
------------------------------
Date: 27 Jul 2000 23:21:30 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help!
Message-Id: <8lqcla$rkc$1@orpheus.gellyfish.com>
On Thu, 27 Jul 2000 09:02:20 GMT Simon wrote:
> Hey everyone thanks for telling me to use Mime::Lite, if only I had read the
> first post ;¬)
>
> What I need it for someone to help me write the Perl for this, and I *might*
> be able to offer some money for this..
>
I'm not interested. Just use Deja News - many people have posted examples
here.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Fri, 28 Jul 2000 09:33:49 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Is this a bogus -w warning?
Message-Id: <tkk2osc7jin3u153tmj0h9af3skdl8vjbi@4ax.com>
Robert Goff wrote:
>if ( my $buyer_email = 'robert@goff.com' ) {
> ... do stuff with $buyer_email...
>}
>
>This is a technique I've been using for months and this is the first time
>I've seen this complaint.
This isn't the actual code, is it? Because doing a logical test on a
constant value doesn't make too much sense. Therefore, Perl is trying to
be helpful, and warns against a possible frequently made mistake.
It won't complain here:
if(my $buyers_email = $email) {
...
}
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 08:49:08 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Making and extracting from XML-like string
Message-Id: <1qh2oskin0j695ij254bfbuhl63qch80ob@4ax.com>
Mark W. Schumann wrote:
>The thing about using regexes is that you'll have to deal with
>funkiness like:
>
> <address type=email>
> Fred & Barney@stonehenge.com <a couple of great guys>
> </address>
>
>or
>
> <formulation>
> if x < y and y > 0 but z < 1 if and only if y > 1, then who knows?
> </formulation>
Both are not legal XML. XML::Parser won't accept it. You MUST escape all
literal "<", "&" and ">" characters by entities ("<", "&" and
">" respectively).
XML *is* simple to parse. The only snag for doing it with regexes is
that tags may be split over several lines.
If XML::Parser is too strict, something derived from HTML::Parser might
do the trick. I dunno, maybe HTML::Parser *is* already updated so it can
accept that funky "<tag/>" style tag syntax as well.
--
Bart.
------------------------------
Date: 28 Jul 2000 03:29:10 EDT
From: abigail@foad.org (Abigail)
Subject: Re: MTA/POP3 server in Perl
Message-Id: <slrn8o2dht.vcg.abigail@alexandra.foad.org>
Yann Ramin (atrus@atrustrivalie.eu.org) wrote on MMDXXIII September
MCMXCIII in <URL:news:3980F5BE.173C740C@atrustrivalie.eu.org>:
\\
\\ Does anyone think a good high performance (not so restricvely licensed)
\\ qmail like MTA is possible in Perl?
No.
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+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Fri, 28 Jul 2000 08:01:50 GMT
From: "James" <jthomson110@home.com>
Subject: New Site: www.perlmodules.com
Message-Id: <O5bg5.85401$dF.3054859@news1.rdc1.il.home.com>
www.perlmodules.com
Please note of a new up and coming
centralized site for all info
regarding Perl Modules. Any suggestions for what
you would like to see on this site would be helpful.
www.perlmodules.com
------------------------------
Date: 28 Jul 2000 04:33:12 EDT
From: abigail@foad.org (Abigail)
Subject: Re: New Site:
Message-Id: <slrn8o2h9v.vcg.abigail@alexandra.foad.org>
James (jthomson110@home.com) wrote on MMDXXIII September MCMXCIII in
<URL:news:O5bg5.85401$dF.3054859@news1.rdc1.il.home.com>:
''
'' Please note of a new up and coming
'' centralized site for all info
'' regarding Perl Modules. Any suggestions for what
'' you would like to see on this site would be helpful.
Ah, just what we need. Yet another Perl site that claims to be central....
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: Fri, 28 Jul 2000 08:48:15 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: New Site:
Message-Id: <slrn8o2ifs.gk7.rgarciasuarez@rafael.kazibao.net>
Abigail wrote in comp.lang.perl.misc:
>perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
This one is really amazing.
It reminds me some demonstrations on formal languages shown in the
book 'Godel,Escher,Bach'...
I wonder how fast the NFA behaves to solve the match?
--
Rafael Garcia-Suarez
------------------------------
Date: Fri, 28 Jul 2000 10:01:32 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <964775048.14661.0.nnrp-01.c3ad6973@news.demon.co.uk>
jtoy wrote in message <3980B1AB.6DBC99F2@tcgfinancial.com>...
>Oh and why would I hire someone if I'm only 18 and probably make more than
you
>doing programming and network communications?
>
Oo-oo-oh, get her.
I started off with some sympathy (think about this word - I don't mean it in
the hankies out sense) for you.
Now, I wonder why that perl guy left.
PS I'd just dump that original code if I were you.
------------------------------
Date: 27 Jul 2000 23:30:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: nntp client
Message-Id: <8lqd6a$rmn$1@orpheus.gellyfish.com>
On 27 Jul 2000 13:27:33 EDT Abigail wrote:
> Chris Morris (chris.morris@supanet.net.uk) wrote on MMDXXII September
> MCMXCIII in <URL:news:39806192.A13ED925@supanet.net.uk>:
> || Does anyone know of a script that will act as a newsreader?
>
>
> perl -e 'exec "slrn"'
>
I use :
$suck = '/usr/bin/suck news.btinternet.com -f -C 20 -n -c -dd /var/lib/news -dt /var/lib/news -dm /var/tmp/news -bl /var/lib/news/lmove-config';
system($suck);
I guess it could be improved but hey !
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 28 Jul 2000 10:16:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Nobody loves me?
Message-Id: <8lrj28$t3u$1@orpheus.gellyfish.com>
In comp.lang.perl.misc Jason Dixon <fuzzyping@freewwweb.net> wrote:
<snip whingeing>
> I've written a script to email a list of people with updates on my
> site. The script works great, except I'm having difficulty customizing
> the "From" section of the header (no problems at all with the
> "Subject"). Instead of changing the From header to my variable, it uses
> the "real" header (from a machine that is NOT in my domain), then
> inserts the new header into the body of the email (???).
>
> As always, TIA!
> -Jason
>
> <snippet>
> foreach $name (<INPUT>) {
> chomp;
> $from = "Jason <jason\@domain.com>";
> $subject = "shtuff goes here";
> $mailer = Mail::Mailer->new("sendmail");
> $mailer->open({ From => $from,
> To => $name,
> Subject => $subject,
> }) || die "can't open: $!";
> print $mailer $body;
> $mailer->close();
> }
> </snippet>
>
Well I cant repeat the behaviour you are getting. I can do this :
#!/usr/bin/perl -w
use strict;
use Mail::Mailer;
my $mailer = new Mail::Mailer 'sendmail';
my $header = {
To => 'gellyfish@gellyfish.com',
Subject => 'This is a test',
From => 'Jonathan Stowe <gellyfish@Blahwoof.com>'
};
$mailer->open($header);
my $body = 'This is test body';
print $mailer $body;
$mailer->close;
And I Get the mail thus :
Return-Path: <gellyfish>
Received: (from gellyfish@localhost)
by orpheus.gellyfish.com (8.9.3/8.9.3) id JAA29680;
Fri, 28 Jul 2000 09:37:27 +0100
Date: Fri, 28 Jul 2000 09:37:27 +0100
Message-Id: <200007280837.JAA29680@orpheus.gellyfish.com>
Subject: This is a test
From: Jonathan Stowe <gellyfish@Blahwoof.com>
To: gellyfish@gellyfish.com
This is test body
Likewise if I use SMTP :
Return-Path: <gellyfish@orpheus.gellyfish.com>
Received: from orpheus.dircon.net (IDENT:gellyfish@localhost [127.0.0.1])
by orpheus.gellyfish.com (8.9.3/8.9.3) with ESMTP id JAA29657
for <gellyfish@gellyfish.com>; Fri, 28 Jul 2000 09:31:50 +0100
Date: Fri, 28 Jul 2000 09:31:50 +0100
Message-Id: <200007280831.JAA29657@orpheus.gellyfish.com>
X-Mailer: Mail::Mailer[v1.19] Net::SMTP[v2.15]
Subject: This is a test
To: gellyfish@gellyfish.com
From: Jonathan Stowe <gellyfish@Blahwoof.com>
This is test body
I can only think that there is either a problem with the version of
Mail::Mailer you are using in which case you should upgrade or their
is a configuration issue with your sendmail in which case you take it
up with some sendmail newsgroup. There is nothing particularly unusual
about my sendmail config. An alternative might be for you to use SMTP
to send the message to your MTA on localhost.
Having looked at the code for Mail::Mailer and Mail::Mailer::sendmail I
would have to lean toward some fascist setting of sendmail.cf as nothing
is done to your headers that might cause what you are experiencing.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 28 Jul 2000 01:08:25 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl sequivallent for tidy (HTML fixup program)?
Message-Id: <8lqitp$rso$1@orpheus.gellyfish.com>
In comp.lang.perl.misc William Herrera <posting.account@lynxview.com> wrote:
> On Wed, 26 Jul 2000 12:06:08 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>
>>> >Hi, I am currently looking at running some program HTML output (from a
>>> >text or MS word to HTML translator) through tidy via system() in a perl
>>> >program. Is there a native perl equivalent to the tidy program for
>>> >cleaning up HTML?
>>>
>>> http://www.fourmilab.ch/webtools/demoroniser/
>>>
>>> was made with that purpose
>>>
>>> by
>>> John Walker
>>> http://www.fourmilab.ch/
>>>
>>> It might be just what you are looking for.
>>
>>A somewhat updated version of that program can be found at
>>
>><URL:http://www.perl.com/language/misc/demoroniser.html>
>
> Grabbed and saved to disk. However there is the matter of old HTML -> XHTML,
> which involves changing
>
> <p> sometext <p> someothertext
>
> to
>
> <p> sometext </p> <p> someothertext </p>
>
> which tidy does nicely. I guess I'll just use the tool.
>
This is why you were recommended to look at something based on
HTML::TreeBuilder which can determine the structure of the document in
this way to a better extent.
>
> And, to thie standard module writers:
>
> Does anyone (ie Lincoln Stein) know how close to standard XHTML current CGI.pm
> output is nowadays?
Probably nowhere - a patch would probably be welcome.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Jul 2000 23:24:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: regex email blocker
Message-Id: <8lqcrp$rkf$1@orpheus.gellyfish.com>
On Thu, 27 Jul 2000 10:05:37 -0700 Samay wrote:
> Hi Anyone knows any email service which blocks the email based
> upon your regular expressions.. So you don't have to delete the
> junk mails?
>
procmail - but I dont know what this has to do with Perl.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Fri, 28 Jul 2000 08:40:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: return value of `eval "use lib"'
Message-Id: <tjh2os8tg76pls7ujvkkiob52kesa2730l@4ax.com>
Jakob Schmidt wrote:
>Plus the case where it's actually not the require() bit but the import()
>bit that's tricky. Like in the OP's situation where use lib LIST will fail
>but require lib; import lib LIST will go ahead an not even reveal the
>error condition by return values. In that case
>
>eval "use lib LIST"; @_ and die @_;
>
>is probably the best solution when you want to die on failure (as does the OP)
Wow. This is important. Can you give an example of where use dies, and
require+import ignores the error? There could be a way around it, if
only I have an example of this behaviour.
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 09:40:15 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: return value of `eval "use lib"'
Message-Id: <3ycg5.18944$eS6.295244@news1.rdc1.md.home.com>
In article <8zunupl4.fsf@macforce.sumus.dk>,
Jakob Schmidt <sumus@aut.dk> wrote:
>In that case
>
>eval "use lib LIST"; @_ and die @_;
>
>is probably the best solution when you want to die on failure (as does the OP)
Actually, I checked with gnat about this; he suggested the
following fix for the code in the Cookbook:
if (eval "use lib LIST; 1") {
# success
} else {
# failure
};
. Although I don't think it is functionally any different than
the test of @_, I like it more, since I'm always paranoid and thus don't
want to assume that there is no situation in which the use pragma could
fail but @_ could remain unset.
-- Sweth.
--
Sweth Chandramouli ; <sweth@sweth.net>
<a href="http://www.sweth.net/legal/disc.html">*</a>
------------------------------
Date: 28 Jul 2000 00:46:03 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sending email with attachment
Message-Id: <8lqhjr$rra$1@orpheus.gellyfish.com>
On 25 Jul 2000 15:22:28 GMT Sergey Aleshin wrote:
> Eelke Kleijn <six4eight@nospamhotmail.com> wrote:
>> Hi all,
>
>> I know how to send an email with both plain text and html. I also know how
>> to make clear what the attachment is using
>> Boundary="_NextPart_putsomestuffhere_";
>
>> But what I don't know is how the specify a path to the attachment, if this
>> is possible. I can't seem to find out how to include an attachment that is
>> present in the same directory. I don't want to use a module, by the way.
>
> $ perldoc MIME::Lite
>
> use MIME::Lite;
>
> Or read rfc822 and make your version of this module ;-)
Probably not that RFC - I posted the most recent list of four RFCs that
deal with MIME quite recently.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Fri, 28 Jul 2000 09:22:04 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: shifting strings
Message-Id: <kuj2osk3ed1m3jborb42i6codic57eba7b@4ax.com>
David T. Liu wrote:
>suppose I had a string:
>
>$str1 = "abcd";
>$str2 = shift $str1; #str2 == "abc"
>
>Is there a built-in function that can do what "shift" above does?
That's not right. To be completely equivalent with shift, $str1 should
be modified into "bcd", and $str2 should become "a".
That can be done using the 4 argument substr (new in 5.005).
$str1 = 'abcd';
$str2 = substr($str1, 0, 1, '');
print <<"#EOT#";
\$str1 = '$str1'
\$str2 = '$str2'
#EOT#
-->
$str1 = 'bcd'
$str2 = 'a'
chop() can be used to remove and return the last character. 4 argument
substr() is far more universal. Comparable to, say, splice().
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 09:42:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Should truncate length be 0?
Message-Id: <m3l2oskqu9qqpc7dqru1ervfflu2c383b3@4ax.com>
BUCK NAKED1 wrote:
>One more question. Since Abigail questioned using 0 byte length in the
>truncate coding below, I'd like to hear other opinions about whether it
>is correct or not.
>
>truncate(COUNT, 0) or die "can't TRUNCATE data file: $!";
I've posted a reply in another thread already.
It is correct. Whether it's the most *efficient*, is another matter.
truncate() to zero could well release the disk blocks to the file
system, and a subsequent print() will require the allocatioon of a new
disk block. In that way, overwriting what you had before would be more
efficient.
However, This sequence:
seek FILE, 0, 0;
print FILE, $data;
truncate FILE, tell FILE;
*has already failed* on me, on a fews platforms. IT truncated the file
to the wrong length, even though I think that tell() returned the
correct offset.
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 16:34:49 +0800
From: "Xin Li" <lxzy@yeah.net>
Subject: ttt
Message-Id: <8lrgfe$4su$1@info.bta.net.cn>
ttt
------------------------------
Date: 28 Jul 2000 00:15:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: WHOIS not standart query HELP!!!
Message-Id: <8lqfr2$rpg$1@orpheus.gellyfish.com>
On Wed, 26 Jul 2000 19:41:36 GMT ilbot@my-deja.com wrote:
> is there any way to get the list of the Domain Names wich were
> registred by some Persons?
Of course you can, you will need to start a DNS query at the root servers
in order to find the servers for each TLD then you will have to recursively
query every nameserver you find in order to find all of the registered
domains under each TLD, for each domain you find you will need then to
issue a whois query to the appropriate whois server for that TLD ( or
possibly second level domain ) - the appropriate whois server is not
available from any central location so you will need to find them out for
yourself - for every whois server you will need to determine the format
that is returned and then search for the appropriate pattern. You will
need to search the *entire* DNS and issue a whois query for *every* domain
I reckon on a reasonably fast computer with a very fast internet connection
this will only take about a week. You might not want to do this for a web
based application unless you want to return the results by e-mail.
You can use the modules Net::DNS and Net::Whois available from CPAN for this.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Fri, 28 Jul 2000 07:21:06 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: WWWBoard.PL
Message-Id: <8lrbs4$i37$1@localhost.localdomain>
You originally posted to comp.lang.perl, which is long-dead, and
comp.lang.perl.modules, which is inappropriate, as you are not
discussing a module.
In article <39812543@194.255.58.12>, Bjørn Nørgaard <bnp@lknetlon.dk> wrote:
>Does any of you have experience with wwwboard.pl from Matt's Script Archive?
>
>- Can it run on an Intranet?
Um, precisely how is a CGI script supposed to know it's on an intranet?
So the answer is yes.
>- Can it run on a "ordinary" NT4.0/Win2000 Server without having to install
>some kind of Perl-server-support?
It's a CGI script, and requires a Perl interpreter and a properly configured
http server. It runs on Windows.
Oh, and by the way, it is among the worst code I have ever seen. Someone
recently asked about how bad Matt's scripts were and I was tempted to
include a dissection of wwwboard.pl.
Story: a client calls me up, "we have a bulletin board script and we'd like
to have 'next' and 'previous' buttons for each posting. Oh and we want to
be able to delete postings too." I said sure -- how hard could THAT be?
(This is 1997).
It turns out to be NIGH-ON-IMPOSSIBLE. That's because wwwboard.pl keeps
no particular record of its postings, merely an HTML page of links to the
posting files. A unity of data and representation, my my, what could be
simpler? :)
* If that file gets corrupted or deleted, there's *no way* to recover.
Have a nice day!
* It is extremely likely to get corrupted, since the script does no
locking of any kind (at least in '97), and multiple CGI processes can
and will modify it simultaneously.
* The format is kind of brain-dead anyway. He (somewhat cleverly) used
the inherent indentation of <ul><li></li><ul> to indicate any response.
Therefore he could insert postings into the index file at will, just
by checking for a nearby <!-- id number -->.
However, for any real-world discussion, this means the 10th reply will
be indented 80 spaces, i.e., right off the page!
Furthermore, IIRC there is no inherent way to segement postings by date.
You can simply move the index files around (be careful not to do this
while people are posting, oops, you just corrupted those files again!)
but then you can't track a thread across multiple index files. There
is no threading algorithm at all; merely a sequence of postings that
are associated with another posting on the same HTML page with those
lame id numbers.
* The combination of requests my client had -- prev/next + deletion --
was really tricky. Because the prev/next buttons have to "heal" themselves
when I delete a post in the middle of a thread. I eventually got it
to work, but it involves a lot of recursive scanning up and down
HTML files. Call me a crazy but I think bulletin board management
should be easier. This would have been trivial with any non-brain-dead
design, e.g. based on a database of posts and threads.
* As I was going through this code my eyes were bugging out at the
naivete and general stupidity. I was replacing *pages* of code with
single lines. Not even complicated lines. By the time I was done
with it the code did twice as much in 1/2 the space. Back then I had
only been coding perl off and on for a few years. I'd probably be
even more revolted today.
Anyway, if you still want to go with Matt Wright scripts, be my guest. I
would expect it's improved somewhat since '97. But the guy's nickname around
here is Matt Wrong. Does that tell you anything?
--
Neil Kandalgaonkar <neil@brevity.org>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3830
**************************************