[Koha-devel] State of the debian packaging

Rick Welykochy rick at praxis.com.au
Mon Dec 8 12:08:28 CET 2008


Frederic Demians wrote:

> You have:
> 
>     $XML::SAX::ParserPackage = "XML::LibXML::SAX";
>     use MARC::File::XML;
> 
> It doesn't work. I've tested it on a Debian box where I can see 
> immediately if extended characters are properly displayed or not which 
> is not the case with your patch. This modification works:
> 
>     $XML::SAX::ParserPackage = "XML::LibXML::SAX";
>     require MARC::File::XML;

Why is it so?

The "use" statement is executed once at compile time. The only
parameterisation is passed via the use statement itself. In
the above example, the "use' statement is actually executed
before the assignment to ParserPackage. This seems strange until
you realise that "use" is implicitly executed in the BEGIN { }
block for the module or script.

The "require" statement is executed at run time.The
ParserPackage variable is seen during the load of the module
MARC::File::XML. Behavior modified as expected.



cheers
rickw



-- 
_________________________________
Rick Welykochy || Praxis Services

Finster's Law: A closed mouth gathers no feet.



More information about the Koha-devel mailing list