View | Details | Raw Unified | Return to bug 7107
Collapse All | Expand All

(-)Conf.pm (-4 / +27 lines)
Lines 3888-3905 Link Here
3888
=item perl_version
3888
=item perl_version
3889
This will be replaced with the version number of the currently-running
3889
Introduced in 3.4.2  This will be replaced with the version number of the currently-running
3890
perl engine.  Note: The version used is in the $] version format which is
3890
perl engine.  Note: The version used is in the $] version format which is
3891
C<x.yyyzzz>, where x is major version, y is minor version, and z is maintenance
3891
C<x.yyyzzz>, where x is major version, y is minor version, and z is maintenance
3892
version.  So 5.8.8 is C<5.008008>, and 5.10.0 is C<5.010000>. Use to protect rules
3892
version.  So 5.8.8 is C<5.008008>, and 5.10.0 is C<5.010000>. Use to protect rules
3893
that incorporate RE syntax elements introduced in later versions of perl, such
3893
that incorporate RE syntax elements introduced in later versions of perl, such
3894
as the C<++> non-backtracking match. For example:
3894
as the C<++> non-backtracking match introduced in perl 5.10. For example:
3895
  # Avoid lint error on older perl installs
3895
  # Avoid lint error on older perl installs
3896
  if perl_version >= 5.010000
3896
  # Check SA version first to avoid warnings on checking perl_version on older SA
3897
    body  INVALID_RE_SYNTAX_IN_PERL_5_8_8  /\w++/
3897
  if version > 3.004001 && perl_version >= 5.018000
3898
    body  INVALID_RE_SYNTAX_IN_PERL_BEFORE_5_18  /(?[ \p{Thai} & \p{Digit} ])/
3898
  endif
3899
  endif
3900
Note that the above will still generate a warning on perl older than 5.10.0;
3901
to avoid that warning do this instead:
3902
3903
  # Avoid lint error on older perl installs
3904
  if can(Mail::SpamAssassin::Conf::perl_min_version_5010000)
3905
    body  INVALID_RE_SYNTAX_IN_PERL_5_8  /\w++/
3906
  endif
3907
3908
Warning: this test is only defined for 5.10.0!
3909
3910
So as long as perl 5.8 is officially supported, this would be the way to
3911
avoid issues with features introduced after perl 5.8:
3912
3913
  # Avoid lint error on older perl installs
3914
  if can(Mail::SpamAssassin::Conf::perl_min_version_5010000)
3915
    if version > 3.004001 && perl_version >= 5.018000
3916
      body  INVALID_RE_SYNTAX_IN_PERL_BEFORE_5_18  /(?[ \p{Thai} & \p{Digit} ])/
3917
    endif
3918
  endif
3919
3920
3899
=item plugin(Name::Of::Plugin)
3921
=item plugin(Name::Of::Plugin)
3900
This is a function call that returns C<1> if the plugin named
3922
This is a function call that returns C<1> if the plugin named
Lines 4772-4777 Link Here
4772
sub feature_bug6558_free { 1 }
4794
sub feature_bug6558_free { 1 }
4773
sub feature_edns { 1 }  # supports 'dns_options edns' config option
4795
sub feature_edns { 1 }  # supports 'dns_options edns' config option
4774
sub feature_dns_query_restriction { 1 }  # supported config option
4796
sub feature_dns_query_restriction { 1 }  # supported config option
4797
sub perl_min_version_5010000 { return $] >= 5.010000 }  # perl version check ("perl_version" not neatly backwards-compatible)
4775
###########################################################################
4798
###########################################################################

Return to bug 7107