Debian Bash Completion vs POD

It was bugging me that autocomplete for the perldoc command worked for modules and functions but not for bare .pod files. I'd be reading the FooBar docs and find a reference to FooBar::Cookbook::Tutorial and the magic TAB key would not find it for me. :(

--- /usr/share/bash-completion/helpers/perl.orig        2013-05-13 06:25:09.163377047 -0700
+++ /usr/share/bash-completion/helpers/perl     2013-05-13 04:10:34.523819280 -0700
@@ -23,8 +23,8 @@
     chdir($dir) or return;

     # print each file
-    foreach my $file (glob('*.pm}')) {
-        $file =~ s/\.pm$//;
+    foreach my $file (glob('*.{pm,pod}')) {
+        $file =~ s/\.(?:pm|pod)$//;
         my $module = $base . $file;
         next if $module !~ /^\Q$word/;
         next if $seen{$module}++;

1 Comment

Thanks for this. You just made my day!

Leave a comment

About zengargoyle

user-pic