[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: couple of warning fixes

From: Alexandre Duret-Lutz
Subject: Re: couple of warning fixes
Date: 22 May 2001 12:02:29 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Akim" == Akim Demaille <address@hidden> writes:


 >> @@ -1498,7 +1498,7 @@ sub handle_languages
 >> my $needs_c = 0;
 >> foreach my $ext (sort keys %extension_seen)
 >> {
 >> -   my $lang = $languages{$extension_map{$ext}};
 >> +   my $lang = $languages{$extension_map{$ext} || ''};

 Akim> Huh???  This looks very wrong to me.  It should probably be something
 Akim> like

 Akim> next
 Akim> unless $extension_map{$ext};

Yeah, sorry.  I first made that change in
handle_single_transform_list where this line is followed by 
`if ($lang)' (I beleive it's ok here), and then I changed each 
other use of $languages{$extension_map{$ext}} similary.  
That was a bad idea.

 Akim> Actually, I'm frightened: how come Perl does not complain about
 Akim> $languages{''}?  It is not supposed to exist.  Does it?

I beleive it's undefined too but that it was not used in places
where a defined value is needed.  Who knows? After all, that's Perl.

Maybe it could be cleaner to register an `unknown' language?
Alexandre Duret-Lutz
Safety critical systems in Perl.  Buy my plane, it's scriptable!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]