silence -w noises (suggested by Greg Bacon)
Gurusamy Sarathy [Sat, 17 Oct 1998 04:11:40 +0000 (04:11 +0000)]
p4raw-id: //depot/perl@2003

lib/Term/Complete.pm

index 275aade..f26be77 100644 (file)
@@ -13,8 +13,8 @@ Term::Complete - Perl word completion module
 
 =head1 SYNOPSIS
 
-    $input = complete('prompt_string', \@completion_list);
-    $input = complete('prompt_string', @completion_list);
+    $input = Complete('prompt_string', \@completion_list);
+    $input = Complete('prompt_string', @completion_list);
 
 =head1 DESCRIPTION
 
@@ -74,6 +74,9 @@ CONFIG: {
 sub Complete {
     my($prompt, @cmp_list, $return, @match, $l, $test, $cmp, $r);
 
+    $return = "";
+    $r      = 0;
+
     $prompt = shift;
     if (ref $_[0] || $_[0] =~ /^\*/) {
        @cmp_lst = sort @{$_[0]};
@@ -113,8 +116,8 @@ sub Complete {
                 # (^U) kill
                 $_ eq $kill && do {
                     if ($r) {
-                        undef $r;
-                       undef $return;
+                        $r     = 0;
+                       $return = "";
                         print("\r\n");
                         redo LOOP;
                     }