in reply to Dynamically overwriting a line of text on stdout console

Check to see if $\ is defined as "\n". It is undefined by default. Perl print will add on a $\ at the end of each print's arguments, as well as a $, between each argument.

If it's defined because you need it, you can localize $\ for this bit.

{ local $\; print 'somestuff'; print "\rOVERWRITE\n"; }

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Dynamically overwriting a line of text on stdout console
by freddo411 (Chaplain) on Jul 22, 2004 at 22:52 UTC
    This in fact works:
    $\ = undef ; print 'somestuff'; print "\rOVERWRITE\n";
    But I don't understand, because:
    print "Text"; print " MoreText\n";
    Does not get printed as:
    Text MoreText
    as $\ being "\n" would seem to imply. I am using version 5.005.

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday