develooper Front page | perl.perl5.porters | Postings from November 2004

[perl #32686] Term::ReadLine::readline.pm and extensions like "mark-symlinked-directories"

From:
paul . fardy @ utoronto . ca
Date:
November 29, 2004 14:56
Subject:
[perl #32686] Term::ReadLine::readline.pm and extensions like "mark-symlinked-directories"
Message ID:
rt-3.0.11-32686-101220.16.4728580898277@perl.org
# New Ticket Created by  paul.fardy@utoronto.ca 
# Please include the string:  [perl #32686]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=32686 >



This is a bug report for perl from paul.fardy@utoronto.ca,
generated with the help of perlbug 1.34 running under perl v5.8.0.


-----------------------------------------------------------------
[Please enter your report here]

It appears that Red Hat's distributed /etc/inputrc contains

	set mark-symlinked-directories on

which Term::ReadLine::readline does not currently recognize.
I presume that many other GNU systems may be use this (or other)
readline extensions.

As a result, use of Term::ReadLine generates complaints:

	Undefined value assigned to typeglob at (eval 11) line 15, <RC> line 11.
	Warning [/etc/inputrc line 11]:
	  Invalid variable `mark-symlinked-directories'

The warning is only presented in "if $^W", but that's always when you
believe that "-w is optional" is a bug as the man page once said. :-)
Moreover, the "Undefined value ..." message is redundant and unfriendly
to the typical user.

[ Even the latter message is a bit obscure, for that matter.  'What
  the heck is "/etc/inputrc"?'  But that's hardly something Perl can
  change. :-) ]

Still, there are two considerations:

The Lesser: can readline.pm be updated to support the new variables?
    A few extra default values would fix things, ... for now.

The Greater: can readline.pm be updated to handle such extensions more
   elegantly?
   (1) an option to allow "no warnings" within readline alone.
   (2) a patch (provided) to removed the "Undefined value ..." message:
   	Test the value before using it:

	CURRENT:
       local(*V) = $ {'readline::'}{"var_$_"};   # generates warning
       if (!defined($V)) {
	  	warn "Warning: ...";

     IMPROVED:
	  unless (defined ${'readline::'}{"var_$_"}) {
	  	warn "Warning: ...";
		return;
	  }
       local(*V) = $ {'readline::'}{"var_$_"};   # won't generate warning
	  ...

   It would also be useful to have lint-like extended comments in the input
   file.  In /etc/inputrc

   	# :perl: Term::ReadLine allow mark-symlinked-directories 
	set mark-symlinked-directories on

   but that would be stuff of wishes or, at least, the wishlist category. :-)

Thanks for your time,

Paul
-- 




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About