Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
So i changed the call in something like:Undefined subroutine &readline::rl_basic_commands called at...
if (exists &readline::rl_basic_commands){&readline::rl_basic_commands( +keys %cmds);}
#!perl use strict; use warnings; use Term::ReadLine; $ENV{TERM}=undef; my $term = Term::ReadLine->new('xxx'); my %cmds = (a=>1,b=>2); # THIS WORKS &readline::rl_basic_commands(keys %cmds); # THE FOLLOWING CHECK DOES NOT WORK if (exists &readline::rl_basic_commands){print "BEFORE WHILE EXISTS +\n"; &readline::rl_basic_commands(keys %cmds);} while ( defined ( $_ = $term->readline( '>') ) ) { print "$_\n"; } continue{ # THIS CHECK WORKS INDEED! if (exists &readline::rl_basic_commands){print "IN CONTINUE EXISTS\ +n"; &readline::rl_basic_commands(keys %cmds);} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: about Term::ReadLine and it's imported function
by LanX (Saint) on Nov 24, 2014 at 13:31 UTC | |
by Discipulus (Canon) on Nov 24, 2014 at 19:02 UTC | |
by LanX (Saint) on Nov 24, 2014 at 20:25 UTC | |
|
Re: about Term::ReadLine and it's imported function
by LanX (Saint) on Nov 24, 2014 at 16:47 UTC | |
by Discipulus (Canon) on Nov 24, 2014 at 19:20 UTC | |
by Discipulus (Canon) on Nov 25, 2014 at 09:54 UTC | |
by LanX (Saint) on Nov 25, 2014 at 14:52 UTC | |
|
Re: about Term::ReadLine and it's imported function
by gnosti (Chaplain) on Nov 25, 2014 at 20:40 UTC |