Nice try! Instead, try printing "\r" to bring the cursor back to the beginning of the line. That way you can overwrite the same line to your heart's content.
#! /usr/bin/perl use strict; my $in = shift || '/usr/dict/words'; open IN, $in or die "Cannot open $in for input: $!\n"; while( <IN> ) { chomp; print "$_\r"; } close IN; print "\n";
In reply to Re: Writing to same line in STDOUT
by grinder
in thread Writing to same line in STDOUT
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |