1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
# 20new.patch by Niko Tyni <ntyni@iki.fi>
# DP: Fix new() argument checking and documentation.
# DP: (#204362, patch by Nicolas Bertolissio)
--- a/Gnu.pm
+++ b/Gnu.pm
@@ -220,7 +220,7 @@
sub ReadLine { 'Term::ReadLine::Gnu'; }
-=item C<new(NAME,[IN[,OUT]])>
+=item C<new(NAME,[IN,OUT])>
returns the handle for subsequent calls to following functions.
Argument is the name of the application. Optionally can be followed
@@ -234,6 +234,7 @@
my $this = shift; # Package
my $class = ref($this) || $this;
+ croak "Wrong number of arguments" unless @_==1 or @_==3;
my $name = shift;
my $self = \%Attribs;
|