in reply to Writing to same line in STDOUT
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Writing to same line in STDOUT
by mugwumpjism (Hermit) on Jun 14, 2001 at 14:35 UTC |