[Mimedefang] Eml Attachments

Kevin A. McGrail KMcGrail at PCCC.com
Sun Nov 20 09:53:59 EST 2011

On 11/20/2011 9:45 AM, Jan-Pieter Cornet wrote:
> Hash: SHA256
> On 2011-11-18 19:34 , Kevin A. McGrail wrote:
>> Note, add/create sub filter_initialize {
>>    use File::Copy;
>> }
> That's superfluous and even slightly wrong. "use" is a compile-time directive, so there's really no point putting it in a subroutine (unless you want to localise the scope of the exported functions/variables, which currently doesn't work really well, but is most certainly NOT what you intended here).
> Just put 'use' statements at the top of your script.
I see your point but I've done it more for following convention for 
mimedefang.  Haven't seen any issues, though either.  And I also don't 
completely know what magic DFS has done for embedded perl.  I can say 
that having it in filter_initialize works in and out of embedded perl 

I took a look at http://perldoc.perl.org/functions/use.html and except 
for compiler directives, I would interpret the docs as saying it doesn't 

"Some of these pseudo-modules import semantics into the current block 
scope (like |strict| or |integer| , unlike ordinary modules, which 
import symbols into the current package (which are effective through the 
end of the file). Because |use 
<http://perldoc.perl.org/functions/use.html>| takes effect at compile 
time, it doesn't respect the ordinary flow control of the code being 
compiled. In particular, putting a |use 
<http://perldoc.perl.org/functions/use.html>| inside the false branch of 
a conditional doesn't prevent it from being processed."


More information about the MIMEDefang mailing list