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 :)