[TxMt] Interactive input in Textmate (for Perl)

Jon2010 octoberlyz at hotmail.com
Mon Mar 8 03:27:55 UTC 2010


Hi guys,

When I was trying to do some interactive input with Perl in TM, I got some
weird output.

For example, I use this script:

#!/usr/bin/perl -w 
$pi = 3.14; 
print "What is the radius? "; 
chomp($radius = <STDIN>); 
$circ = 2 * $pi * $radius; 
print "The circumference of a circle of radius $radius is $circ.\n"; 

When I run the script and input "4", the output is this:

4
What is the radius? The circumference of a circle of radius 4 is 25.12.

I mean, when I input "4", I don't see the msg "What is the radius?".
Shouldn't TM first show this msg and then, as the user, I input "4"?

I know that there is some issue with interactive input in TM
(http://blog.macromates.com/2009/interactive-input/). Before I made the
changes mentioned in that thread, I was even not able to use interactive
input in TM. Now I can, but it just seems weird as mentioned above. And if I
run the script in the Terminal, everything is OK - I first got a msg "What
is the radius?", then I input whatever I want.

Any ideas about this?

Thanks,
Jon
-- 
View this message in context: http://old.nabble.com/Interactive-input-in-Textmate-%28for-Perl%29-tp27816791p27816791.html
Sent from the textmate users mailing list archive at Nabble.com.




More information about the textmate mailing list