From owner-freebsd-questions@FreeBSD.ORG Wed Jan 25 19:29:40 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7D0916A41F for ; Wed, 25 Jan 2006 19:29:40 +0000 (GMT) (envelope-from nalists@scls.lib.wi.us) Received: from mail.scls.lib.wi.us (mail.scls.lib.wi.us [198.150.40.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 734F943D45 for ; Wed, 25 Jan 2006 19:29:40 +0000 (GMT) (envelope-from nalists@scls.lib.wi.us) Received: from [172.26.2.238] ([172.26.2.238]) by mail.scls.lib.wi.us (8.12.9p2/8.12.9) with ESMTP id k0PJTdR4070056; Wed, 25 Jan 2006 13:29:39 -0600 (CST) (envelope-from nalists@scls.lib.wi.us) Message-ID: <43D7D1A3.8070008@scls.lib.wi.us> Date: Wed, 25 Jan 2006 13:29:39 -0600 From: Greg Barniskis User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Jack Stone References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Perl script help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2006 19:29:40 -0000 Jack Stone wrote: > I'm using an old (2001) canned perl script to manage questions to my > tech site. It is of big help since it can answer common questions from > templates and a real time saver. First, this isn't really a FreeBSD question, so you may certainly have better luck getting it answered in a Perl-oriented forum (or best, the help forum or the original author of the script in question). [snip] > Is there any way to insert the same type of tests on those original > copies in the storage as "*.ftf" files and just delete them so they > aren't there when the question manager program is loaded?? If I were you I would be looking at the Perl code just before those lines that you quoted in your original message. Inspect the content of $FORM{message} earlier in the process and use Perl pattern matching to see if it contains taboo content. Something like if ($FORM{message} =~ /taboophrase/) { msgisjunk; } Here I've made up a subroutine name "msgisjunk" that would get executed if "taboophrase" was found in the message. You will need to figure out what is the appropriate thing to do in that situation (might be simply "exit;"), and you may well need a more complex comparison operation, depending on what is normally the format and content of the message data. Basically though, the idea is that if bad content is found then you should skip entirely the section of code that goes about writing the file and sending the email. If the bad content is neither delivered nor stored in a file in the first place, then you don't need any other filtering or deletion to occur. If you don't know much Perl, the numerous Perl books at www.ora.com are generally great reading, IMHO. Start with _Learning Perl_. -- Greg Barniskis, Computer Systems Integrator South Central Library System (SCLS) Library Interchange Network (LINK) , (608) 266-6348