Subject: Bug#183361: debconf: v1.2.31 822.pm script errors during apt-get install

From: "Alfie Costa" <[email-masked]>
Date: Fri, 7 Mar 2003 18:31:36 -0500

On 6 Mar 2003, at 17:58, Joey Hess <[email-masked]> wrote:  

> You could try apt-get --reinstall install. 

Tried, as per your advice.  No error.

> You could also try dpkg-reconfiguring them. 

Again, no error.

Note that both of these were reinstalling console-common v0.7.21, but NOT 
replacing v0.7.20, as was the case with the error.

> I don't see anything to lead to the problem you reported though. 

A peek through '822.pm' shows the relevant lines of code:

Use of uninitialized value in substitution (s///) at 
/usr/share/perl5/Debconf/Format/822.pm line 57, <$__ANONIO__> line 2502.  

    57                          $value=~s/\\n/\n/g;

Use of uninitialized value in substitution (s///) at 
/usr/share/perl5/Debconf/Format/822.pm line 72, <GEN6> line 9.

    72                  $val=~s/\n/\\n/g;

Use of uninitialized value in concatenation (.) or string at 
/usr/share/perl5/Debconf/Format/822.pm line 73, <GEN6> line 9.  

    73                  print $fh ucfirst($field).": $val\n";

I don't speak 'perl' too well at present, and can barely guess what the code is 
doing.  Lines #57 & #72 are suspiciously similar, and #73 depends on #72, 
probably failing because '$val' is bad.  The assignments look like 'sed' 
commands, maybe in line #72 a global search for linefeeds, replacing these with 
"\n", and vice-versa for #57.

If so, how can #57 have an 'uninitialized value'?  Where is the input data for 
line #57 (& #72) anyway?  (Some standard Perl buffer I suppose.)  What does 
'$__ANONIO__' mean?

One way or another, any code that takes the trouble to complain is suspicious.  
Either it can't handle the input it's supposed to, or it's erroneously being 
given input it isn't supposed to handle.