in reply to Re: Pipping a script with prompts into less (edit script)
in thread Pipping a script with prompts into less
Thanks!
Question1:
After I type my answer (which I can't see), I'm in less with just
Question1:
C
D
(END)
I'd like to be able to see A and B too (and before the prompt)
Three questions:
- What is $validator supposed to be? A ref to a subroutine or something else?
- None of the output before the prompt is visible until after the prompt is done, what do I do if I want to see that before the prompt?
- What if I'm not piping the script into less? How can I see everything after the prompt?
My example code:
print "A"; print "B"; prompt("Question1:", "", "Wrong answer try again:"); print "C"; print "D"; sub prompt { # same as above excpet I commented out the if $validator-> part }
when I do
all I see at first is:./myscript.pl | less
Question1:
After I type my answer (which I can't see), I'm in less with just
Question1:
C
D
(END)
I'd like to be able to see A and B too (and before the prompt)
Also if I don't pipe the script into less I don't see anything after the prompt (yes I realize that wasn't part of my original question but it should have been).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Piping a script with prompts into less (edit script)
by tye (Sage) on Oct 19, 2012 at 02:37 UTC |
In Section
Seekers of Perl Wisdom