Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Prompting for input inside IDE run (was Reading from STDIN)

by haj (Vicar)
on Mar 27, 2023 at 14:52 UTC ( #11151260=note: print w/replies, xml ) Need Help??


in reply to Re^2: Prompting for input inside IDE run (was Reading from STDIN)
in thread Prompting for input inside IDE run (was Reading from STDIN)

With mode-compile, which is no not core but the default in cperl-mode.

That would have been helpful to know. That entry is disabled in my Emacs because I don't have mode-compile. Heck, that thing is pretty stale and can't be byte-compiled nor M-x eval-buffered in Emacs 27...

Anyway, mode-compile is the culprit. Contrary to its name, it runs the program, using a mechanism which does not make STDIN of the Perl process available to you.

What you could do is wrap the following lisp snippet into a command which suits you:

(compile "perl your_script.pl" t)

Replacing the program name perl and script name your_script.pl by variables is left as an exercise to the reader. The t parameter does the trick to give you what Emacs calls a "comint" environment. So, you end up in a buffer *compilation* in compilation-mode with "clickable" error messages, but the buffer is not read-only, you can just enter text after the prompt.

Replies are listed 'Best First'.
Re^4: Prompting for input inside IDE run (was Reading from STDIN)
by LanX (Saint) on Mar 27, 2023 at 14:57 UTC
    > (compile "perl your_script.pl" t)

    Yes, thanks, I already figured this out in the meantime.

    > variables is left as an exercise to the reader.

    That's one of the things mode-compile does for me (and is expected from an IDE nowadays)

    I will try to find a way to patch/configure mode-compile accordingly.

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2023-10-04 23:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?