Hi Oli

You must use this format to tell perl what version is required. This format is 
working in all perl 5.x releases.

--------------------

package Kernel::System::EmailParser;

use 5.008_001;                       # Perl 5.8.1 or higher

use strict;
use warnings;

use Mail::Internet 2.001;            # version 2.1.0 or higher
use MIME::Parser 3.012_001;          # version 3.12.1 or higher
use MIME::QuotedPrint;               # all versions
use MIME::Base64 0.001;              # v 0.1.0 or higher
use MIME::Words 2.002_014 qw(:all);  # v 2.2.14 or higher
use Mail::Address;                   # all versions
use Kernel::System::Encode;          # all versions

--------------------


PS: Read Chapter 17.4 of PerlBestPractices for more information.  ;-)

 
  Best regards,
  Manuel Hecht
 
((otrs)) :: OTRS AG :: Europaring 4 :: D - 94315 Straubing
  Fon: +49 (0)9421 56818 0 :: Fax: +49 (0)9421 56818 18
   http://www.otrs.com/ :: Communication with success!
 
 

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Oliver Tappe
Gesendet: Dienstag, 5. Februar 2008 13:26
An: Development community of OTRS.org
Betreff: [dev] use of $VERSION in our Perl modules

Hi again,

most (all?) of the OTRS modules incorporate define $VERSION as the CVS
revision of the file.

I doubt that $VERSION is currently being used to declare version dependencies,
but should it ever be, we could experience an unpleasant surprise:

Trying to include this example module
--------------------
package module;

use strict;
use warnings;

our $VERSION = 1.32;

1;
---------------------

yields the following results:

[EMAIL PROTECTED]:~/Sources/temp/test> perl -e 'use module;'
[EMAIL PROTECTED]:~/Sources/temp/test> perl -e 'use module 1.32;'
[EMAIL PROTECTED]:~/Sources/temp/test> perl -e 'use module 1.33;'
module version 1.33 required--this is only version 1.32 at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
[EMAIL PROTECTED]:~/Sources/temp/test> perl -e 'use module 1.101;'

So from Perl's point-of-view, $VERSION 1.101 is smaller than 1.32. While that
could be expected, it is not quite what we need, as CVS revisions reach into
the thousands, easily.

Additionally, with CVS we'd have to cope with the branch-revisions having a
different, more complicated format (e.g. 1.465.2.62).

So we should probably make up our mindes if we should drop the idea of
checking $VERSION of our own modules (and perhaps drop the definition of
$VERSION from all modules to force that) or if we should move the contents of
$VERSION to a different format that does not depend on the CVS revision.

So - what is the exact purpose of $VERSION in our own modules?

Anyway, just to share what I found out after a discussion with Thomas.

cheers,
    Oliver


_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev


_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to