[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] print chars to STDOUT without \n?



At 9:07 AM 2/18/97, alex dosher wrote:
> hi,
>
> i want to print one char at a time to STDOUT, but print doesn't flush the
> buffer until it hits a \n.  i seem to vaguely remember that this is
> possible, but i can't figure it out; printf "%c" doesn't work (at all - i
> get a "Argument isn't numeric in prtf" error) - any ideas?
>
> thanks,
>
> alex.

I don't know what you want to do.
It will slove that to put one char at one time.

$yourText = 'your text';
@yourText = $yourText;
select (STDOUT); $| = 1;
for($i=0;$i<= length($yourText);$i++)
{
   print $yourText[$i];
}

It's not beauty but works.