Silent Zed> You could very simply match the email address, like so:
Silent Zed> $text =~ m/[EMAIL PROTECTED]/g;

Randal L .Schwartz> WRONG.  WRONG WRONG WRONG.  Please read the FAQ on this.
Randal L .Schwartz> And dare I say again, WRONG.

Ok, well I'm going to go out on a limb here, and defend my corner :-).
Having just read 'again' the FAQ after thinking I had missed some glaringly
obvious error. The spec of the job was to quickly scan through pages that
may contain an email address, and replace @s with #s as an anti-spam
measure. Sara 'owned' the pages and even gave demonstration text of the
types of emails that where contained therein and that she was referring to.
We all know that one cannot validate email addresses as simply as using a
REGEXP, in fact there's a whole bunch of PERL modules and scripts on CPAN
designed specifically for handling this task better. I also agree that
assuming this is a common failing. But I think based upon the 'scope' of the
script it's 99.99% safe to use the previous code to accomplish this, based
on the following reasons.

1) The pages being scanned where owned so it's likely the user had a good
idea of the types of email contained within.
2) Most 'email whore' software simply uses the same REGEXPs to leech emails
from web pages anyhow, so will skip over any non standard (x.400, ARPANET,
etc.) email addresses.
3) The question was asked on the 'perl-beginners' list, and because of this
I may have made the wrong assumption, but I wouldn't expect an enterprise
class program to be coded by a beginner asking for free help on a mailing
list - no offence to Sara, who asked the question - but if it needed to go
past the scope of using a simple REGEXP to match the emails, I doubt the
question would have been asked on this list.
4) I have presumed the user just wanted a quick a dirty solution to a
problem that they had no idea of how to tackle.
5) Another, perhaps incorrect assumption, but people using non standard
addresses, (such as x.400) will probably have ways and means of dealing with
spam themselves and wont need a webmaster, or in this case a webmistress, to
kindly modify their address so they aren't picked up by spammers.
6) Unfortunately, I still live in the 'real-world', where nothing is perfect
and a quick hack is better than no hack. If you can go one better, then
please feel free to hack the hack, and take the time out to make the code
better, don't criticise people for offering help. The internet doesn't need
this, it's already changed too much in the last 5 years, and if people can't
offer a little help without getting flamed then surely there's something
"WRONG!"

Hmm... on that note, please understand I don't want to start a flame war - I
simply don't have the time or energy - but when someone takes time out of
their life (Zed) to offer a complete stranger assistance (Sara), surely
there's something up with society (Randal?) when they get pounced on for not
explaining in great lengths why the free code they have supplied will simply
skip-over 0.01% of the email addresses in the source material. Perhaps
Randal had simply had a rough day, that's understandable, he offers so much
help on this list that I can forgive him for being occasionally rude a
million times over, but we shouldn't set this as a standard model of
behaviour.

I'd like to know the thought's of other people are on this though, was I
wrong to post a quick and dirty solution to a problem?

Kindest Regards, Keith Szlamp (aka Silent Zed)


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to