Skip to Content.
Sympa Menu

devel - [sympa-dev] Problems with perl 5.10

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Micah Anderson <address@concealed>
  • To: address@concealed
  • Subject: [sympa-dev] Problems with perl 5.10
  • Date: Sat, 4 Oct 2008 21:03:24 -0400

After installation of sympa, it tries to start the daemons, and the
following errors are printed out for each of the daemons:

Setting up sympa (5.3.4-5.2) ...
Starting Sympa mailing list manager: sympaPrototype mismatch: sub
Lock::LOCK_SH () vs none at /usr/lib/sympa/bin/Lock.pm line 38.
Constant subroutine LOCK_SH redefined at /usr/lib/sympa/bin/Lock.pm line 38.
Prototype mismatch: sub Lock::LOCK_EX () vs none at
/usr/lib/sympa/bin/Lock.pm line 39.
Constant subroutine LOCK_EX redefined at /usr/lib/sympa/bin/Lock.pm line 39.
Prototype mismatch: sub Lock::LOCK_NB () vs none at
/usr/lib/sympa/bin/Lock.pm line 40.
Constant subroutine LOCK_NB redefined at /usr/lib/sympa/bin/Lock.pm line 40.
$* is no longer supported at /usr/lib/sympa/bin/sympa.pl line 162.

I made these go away by commenting out:

#sub LOCK_SH {1};
#sub LOCK_EX {2};
#sub LOCK_NB {4};

in Lock.pm on line 38, I dont know if this causes any problems or not.

The other error:

$* is no longer supported at /usr/lib/sympa/bin/parser.pl line 63.



This was deprecated by perl 5.10 as perldoc perlvar says:

$* Set to a non-zero integer value to do multi-line matching
within a string, 0 (or undefined) to tell Perl that it can assume that
strings
contain a single line, for the purpose of optimizing pattern
matches. Pattern matches on strings con taining multiple newlines can
produce confusing results when $* is 0 or undefined. Default is
undefined. (Mnemonic: * matches multiple things.) This variable
influences the interpretation of only &quot;^&quot; and &quot;$&quot;. A
literal newline can
be searched for even when &quot;$* == 0&quot;.

Use of $* is deprecated in modern Perl, supplanted by the &quot;/s&quot;
and &quot;/m&quot;
modifiers on pattern matching.

Assigning a non-numerical value to $* triggers a warning (and makes
$* act if &quot;$* == 0&quot;), while assigning a numerical value to $*
makes
that an implicit &quot;int&quot; is applied on the value.

Which makes me think that maybe this should be changed to use the /m
modifier, but I dont know what this particular function in sympa does.

Due to the fact that the four daemons all produce these errors when
sympa is started, and the effects of running code with unsupported
perlisms and unresolved prototype mismatches makes me think that this
version of sympa should not be released with Debian.

Please find attached a patch that David Moreno Garza made to fix these issues.

Micah
diff -u sympa-5.3.4/src/sympa.pl sympa-5.3.4/src/sympa.pl
--- sympa-5.3.4/src/sympa.pl
+++ sympa-5.3.4/src/sympa.pl
@@ -159,7 +159,7 @@
 
 $log_level = $main::options{'log_level'} if ($main::options{'log_level'}); 
 
-my @parser_param = ($*, $/);
+my @parser_param = ($/);
 my %loop_info;
 my %msgid_table;
 
@@ -890,7 +890,7 @@
 	my ($t_listname, $t_robot);
 	
 	# trying to fix a bug (perl bug ??) of solaris version
-	($*, $/) = @parser_param;
+	($/) = @parser_param;
 
 	## test ever if it is an old bad file
 	if ($t_filename =~ /^BAD\-/i){
--- sympa-5.3.4.orig/src/Lock.pm
+++ sympa-5.3.4/src/Lock.pm
@@ -35,10 +35,10 @@
 use Fcntl qw(LOCK_SH LOCK_EX LOCK_NB);
 use FileHandle;
 
-sub LOCK_SH {1};
-sub LOCK_EX {2};
-sub LOCK_NB {4};
-sub LOCK_UN {8};
+sub LOCK_SH() {1};
+sub LOCK_EX() {2};
+sub LOCK_NB() {4};
+sub LOCK_UN() {8};
 
 my %list_of_locks;
 my $default_timeout = 60 * 20; ## After this period a lock can be stolen
only in patch2:
unchanged:
--- sympa-5.3.4.orig/src/parser.pl
+++ sympa-5.3.4/src/parser.pl
@@ -60,8 +60,8 @@
     my ($old_index, $old_data) = ($index, $data);
     my @old_t = @t;
 
-    my @old_mode = ($*, $/);
-    ($*, $/) = (0, "\n");
+    my @old_mode = ($/);
+    ($/) = (0, "\n");
 
     my $old_desc;
     if (ref($output) eq 'ARRAY') {           
@@ -104,7 +104,7 @@
 	select $old_desc;
     }
     
-    ($*, $/) = @old_mode;
+    ($/) = @old_mode;
 
     ($index, $data) = ($old_index, $old_data);
     @t = @old_t;

 


  • [sympa-dev] Problems with perl 5.10, Micah Anderson, 10/05/2008

Archive powered by MHonArc 2.6.19+.

Top of Page