in reply to Shell-like "print"

Odd. When I use 'printf' in the shell, it prints "\c" as "\c". Nothing special about that. It's *echo* for which \c in (some) implementations is special.

Anyway, in Perl if you want print or printf to not print a newline, just don't put a newline in the string to print. It will only print out a newline if you tell it to print a newline.

As for Perl printing out the line until the in between code is finished, that's because of buffering. You can turn buffering off by setting $| to 1.

See also 'man perlvar'.

Abigail

Replies are listed 'Best First'.
Re: Re: Shell-like "print"
by monk_wannabe (Initiate) on Oct 17, 2003 at 20:31 UTC
    Abagail, I'm not sure what shell you're using, but I'm using Solaris Korn Shell. '\c' doesn't show up in the printf output, but I don't know if there's a difference between leaving it off altgether or not. I read the article in the first reply, and I think I can make it work, or work around it. Thanks! :)
    - I know nothing....