Skip Menu |

This queue is for tickets about the MIME-tools CPAN distribution.

Report information
The Basics
Id: 29085
Status: open
Priority: 0/
Queue: MIME-tools

People
Owner: dmo+pause [...] dmo.ca
Requestors: micah [...] riseup.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 5.420
  • 5.420_01
Fixed in: (no value)



Subject: $/ as given is currently unsupported
I'm getting this error and its causing a lot of problems: $/ as given is currently unsupported at /usr/share/perl5/MIME/Decoder/NBit.pm line 140 This causes the sympa application to crash. Searching on google, it seems to affect also RT and OTRS. Any simple solutions?
Hello Micah, Show quoted text
> $/ as given is currently unsupported at > /usr/share/perl5/MIME/Decoder/NBit.pm line 140 > This causes the sympa application to crash. Searching on google, it seems > to affect also RT and OTRS. > Any simple solutions?
Oh, that's a fun one. Inside IO::ScalarArray's getline() method, we explicitly croak() if the value of $/ is something other than undef or "\n". I've been trying to remove the dependency on IO::Scalar and IO::ScalarArray, but it's not quite complete yet. I'll be uploading 5.420_02 later today, which removes some, but not all, uses of the IO-stringy modules. It might solve your problem, or it might not. In the meantime, can you figure out what's changing $/ in your code (and what the value is) and provide me a simple testcase? Cheers, Dave
From: micah [...] riseup.net
On Fri Aug 31 13:57:30 2007, DONEILL wrote: Show quoted text
> I've been trying to remove the dependency on IO::Scalar and > IO::ScalarArray, but it's not quite complete yet. I'll be uploading > 5.420_02 later today, which removes some, but not all, uses of the > IO-stringy modules. It might solve your problem, or it might not. > > In the meantime, can you figure out what's changing $/ in your code (and > what the value is) and provide me a simple testcase?
After some discussion with a comrade it seems like the following in perlvar(1) is appropos: perlvar(1): You should be very careful when modifying the default values of most special variables described in this document. In most cases you want to localize these variables before changing them, since if you donâ<80><99>t, the change may affect other modules which rely on the default values of the special variables that you have changed. So the right way is to do: local $/; # enable localized slurp mode and the wrong way: undef $/; # enable slurp mode $/ is supposed to be "\n", which makes perl read the streams line per line, you change $/ when you want to read (e.g.) the whole file or with another seperator So, looking into sympa's bounced.pl (attached) to see if it changes $/ we dont find anyting but false-positives. However, looking into bounce-lib.pl (also attached) because bounced.pl brings that in, we find: $/ = "\n"; and another: $/ = ''; so, to fix that we must add a line like this: local $/; to all the sub foo { } blocks where a $/ is used which is what the attached sympa-bounced-fix.patch does. I hope this helps, it seems like it is not really a MIME::Tools bug, but a bug in Sympa (and OTRS and RT)... but if you can work around the bugginess in IO::ScalarArray to make it go away, then you fix bugs in a bunch of code :)
--- bounce-lib.pl.orig 2007-08-31 13:28:49.000000000 -0400 +++ bounce-lib.pl 2007-08-31 13:29:57.000000000 -0400 @@ -27,6 +27,7 @@ sub rfc1891 { my ($fic, $result, $from) = @_; + local $/; # avoid system-wide field seperator contamination $/ = "\n"; my $nbrcpt; @@ -160,6 +161,8 @@ $mercury_143, $altavista, $mercury_131, $type_31, $type_32,$exim_173, $type_38, $type_39, $type_40, $pmdf, $following_recipients, $postfix); + local $/; + ## Le champ separateur de paragraphe est un ensemble ## de lignes vides $/ = '';

Message body is not shown because it is too large.

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #29085] $/ as given is currently unsupported
Date: Fri, 31 Aug 2007 15:24:50 -0400
To: David O'Neill via RT <bug-MIME-tools [...] rt.cpan.org>
From: Micah Anderson <micah [...] riseup.net>
* David O'Neill via RT <bug-MIME-tools@rt.cpan.org> [070831 11:42]: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=29085 > > > Hello Micah, >
> > $/ as given is currently unsupported at > > /usr/share/perl5/MIME/Decoder/NBit.pm line 140 > > This causes the sympa application to crash. Searching on google, it seems > > to affect also RT and OTRS. > > Any simple solutions?
> > Oh, that's a fun one. Inside IO::ScalarArray's getline() method, we > explicitly croak() if the value of $/ is something other than undef > or "\n". > > I've been trying to remove the dependency on IO::Scalar and > IO::ScalarArray, but it's not quite complete yet. I'll be uploading > 5.420_02 later today, which removes some, but not all, uses of the > IO-stringy modules. It might solve your problem, or it might not. > > In the meantime, can you figure out what's changing $/ in your code (and > what the value is) and provide me a simple testcase?
After some discussion with a comrade it seems like the following in perlvar(1) is appropos: perlvar(1): You should be very careful when modifying the default values of most special variables described in this document. In most cases you want to localize these variables before changing them, since if you don’t, the change may affect other modules which rely on the default values of the special variables that you have changed. So the right way is to do: local $/; # enable localized slurp mode and the wrong way: undef $/; # enable slurp mode $/ is supposed to be "\n", which makes perl read the streams line per line, you change $/ when you want to read (e.g.) the whole file or with another seperator So, looking into sympa's bounced.pl (attached) to see if it changes $/ we dont find anyting but false-positives. However, looking into bounce-lib.pl (also attached) because bounced.pl brings that in, we find: $/ = "\n"; and another: $/ = ''; so, to fix that we must add a line like this: local $/; to all the sub foo { } blocks where a $/ is used which is what the attached sympa-bounced-fix.patch does. I hope this helps, it seems like it is not really a MIME::Tools bug, but a bug in Sympa (and OTRS and RT)... but if you can work around the bugginess in IO::ScalarArray to make it go away, then you fix bugs in a bunch of code :) Micah

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.