Re: Perl changes and majordomo

2008-11-26 Thread Marco S Hyman

On Nov 25, 2008, at 1:00 PM, Ingo Schwarze wrote:


Then again, majordomo is long dead and has a bad license.
Perhaps it is not worth so much effort, and the time might be better
spent migrating to something else... mlmmj comes to mind...


Thanks for that idea.   Somehow I missed mlmmj last time I went
looking for a majordomo replacement.   It took some playing to
make up for the dearth of documentation, but I've already converted
one mailing list and see no reason why I shouldn't convert all and
trash majordomo.

// marc



Re: Perl changes and majordomo

2008-11-25 Thread Ingo Schwarze
Hi Marco,

Marco S Hyman wrote on Tue, Nov 25, 2008 at 12:18:18PM -0800:

> I noticed that majordomo now gives this warning when running the
> digest command:
>
> $* is no longer supported at /usr/local/lib/majordomo/digest line 305.
>
> I assume it started when perl was updated to 5.10.0.

Yes.
The legacy majordomo code is not fully compatible with Perl 5.10.
It uses at least one feature long deprecated and now EOL'ed.

The script "digest" is not the only one affected.
More importantly, "majordomo.pl" is also broken.

As we are still using majordomo, i'm considering to check in more
detail in order to provide patches to ports@, but i did not find the
time yet.  Then again, majordomo is long dead and has a bad license.
Perhaps it is not worth so much effort, and the time might be better
spent migrating to something else... mlmmj comes to mind...

Yours,
  Ingo

--
Ingo Schwarze <[EMAIL PROTECTED]>
Serverbetrieb usta.de / studis.de

 - 8< - schnipp - >8 - 8< - schnapp - >8 -

*** CAVEAT *** DISCLAIMER *** DO NOT USE BLINDLY ***
  The following is work by my colleague Jan Reusch.
  So far, it works for us, but it is probably still incomplete.
  I did not check this as thoroughly as i'm usually checking
  patches before publication, so be prepared for breakage.
  I'm only sending this now because Marco asked:
  This is only intended to demonstrate *part* of the problem,
  not to solve it.

--- alt/majordomo.pl Wed Nov  5 17:17:11 2008
+++ neu/majordomo.pl Sun Nov  2 05:00:37 2008
@@ -45,7 +45,7 @@

  sub main'ParseMailHeader  ## Public
  {
-local($save1, $save2) = ($*, $/);
+local($save1) = ($/);
  local($FH, *array) =  @_;
  local ($keyw, $val);

@@ -55,14 +55,14 @@
  local($package) = caller;
  $FH =~ s/^[^':]+$/$package'$&/;

-($*, $/) = (1, '');
+$/ = '';
  $array = $_ = <$FH>;
-s/\n\s+/ /g;
+s/\n\s+/ /gms;

  @array = split('\n');
  foreach $_ (@array)
  {
-   ($keyw, $val) = m/^([^:]+):\s*(.*\S)\s*$/g;
+   ($keyw, $val) = m/^([^:]+):\s*(.*\S)\s*$/gms;
 $keyw =~ y/A-Z/a-z/;
 if (defined($array{$keyw})) {
 $array{$keyw} .= ", $val";
@@ -70,7 +70,7 @@
 $array{$keyw} = $val;
 }
  }
-($*, $/) = ($save1, $save2);
+$/ = $save1;
  }



Re: Perl changes and majordomo

2008-11-25 Thread Matthew Weigel

Marco S Hyman wrote:

I notices that majordomo now gives this warning when running the
digest command:

   $* is no longer supported at /usr/local/lib/majordomo/digest line 305.

I assume it started when perl was updated to 5.10.0.   As one who
dislikes perl enough to have never learned it a clue as to what it
means would be appreciated :-)

http://perldoc.perl.org/5.8.8/perlvar.html

"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 Use of $* is deprecated in modern Perl, 
supplanted by the /s and /m modifiers on pattern matching."


So whatever majordomo is doing with regular expressions, it thinks it's 
handling multi-line strings one way and is probably handling it the 
other way now.

--
Matthew Weigel