diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl
index ff0bd88548fc..d982f563866b 100644
--- a/Doc/perl/python.perl
+++ b/Doc/perl/python.perl
@@ -148,6 +148,16 @@ sub do_cmd_samp{ return use_wrappers(@_[0], '"', '"'); }
sub do_cmd_kbd{ return use_wrappers(@_[0], '', ''); }
sub do_cmd_strong{ return use_wrappers(@_[0], '', ''); }
+sub do_cmd_refmodule{
+ # Insert the right magic to jump to the module definition.
+ local($_) = @_;
+ my $key = next_optional_argument();
+ my $module = next_argument();
+ $key = $module
+ unless $key;
+ return "$module" . $_;
+}
+
sub do_cmd_newsgroup{
local($_) = @_;
my $newsgroup = next_argument();