Trouble with

blkdog wrote on Thu Oct 26 19:10:15 MEST 2006:
I'm have a very pecular problem when using ...

I'm running Eclipse 3.2 & E.P.I.C. 0.5.12, on XP

here's the code ....

#! /usr/bin/perl

print "Enter the string and the number (separate lines):\n";
$strings = ;
chomp($repeat = );
print "Here's your output:\n";
print $strings x $repeat;

when I run this code through the console in Eclipse the prgram blocks for
the first  without printing the first line of text.

I get the following in the console.....

Enter the string and the number (separate lines):
Here's your output:

When I run this on through cmd.exe it runs normally, i.e. it prints a prompt
to the user first, then blocks.  Also runs fine on a Solaris terminal.

Please let me know what I can do...


blkdog - 

pguzis wrote on Thu Oct 26 19:26:23 MEST 2006:
Just a thought, but have you tried turning on autoflush at the beginning
of your script?

$| = 1;
blkdog wrote on Thu Oct 26 19:30:12 MEST 2006:
That worked, Thank-you, ... is this always necessary?
jploski wrote on Thu Oct 26 20:53:09 MEST 2006:
This is a FAQ. Read man perlvar for an explanation on why and when $| =
1 is necessary.

Because so many people run into it, I am going to fix it in some near future.
That is, I am going to make Perl invoked by EPIC behave as if it was writing
to a real terminal if the Console option is enabled in the launch configuration.

Note: The above is an archived snapshot of a forum thread. Use the original thread at to post comments.