Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Permanent prompt waiting for user command

by haukex (Archbishop)
on Dec 03, 2022 at 07:30 UTC ( [id://11148521]=note: print w/replies, xml ) Need Help??


in reply to Permanent prompt waiting for user command

without external module? (I'm in a server offline)

Yes, even you can use CPAN, but you could try and see if this server has a working backend for the core module Term::ReadLine available.

  • Comment on Re: Permanent prompt waiting for user command

Replies are listed 'Best First'.
Re^2: Permanent prompt waiting for user command
by Lucas Rey (Sexton) on Dec 03, 2022 at 07:38 UTC
    Hi, no problem with "use Term::ReadLine;", thank you. Do you have any example code?
      Do you have any example code?

      I thought the Synopsis in the documentation would be enough - you did click the link, right? If you are having trouble with the module, please post the code you're having problems with. See SSCCE and How do I post a question effectively?

        Sure, I click the link :) Problem is that I still have issue on backspace and arrow using the example code:

        use Term::ReadLine; my $term = Term::ReadLine->new('Simple Perl calc'); my $prompt = "Enter your arithmetic expression: "; my $OUT = $term->OUT || \*STDOUT; while ( defined ($_ = $term->readline($prompt)) ) { my $res = eval($_); warn $@ if $@; print $OUT $res, "\n" unless $@; $term->addhistory($_) if /\S/; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found