What does it mean to flush
As already two answers misundestand your question, let me point: the word 'flush' in perl (and not only) context means forcing printout of the buffered output. To understand what it is about, try sth like
for(1..60) {
print "a";
sleep(1);
}
print "\n";
Contrary to what you may expect, for 60 seconds you will get no output, then 60 letters a. This is because perl buffers stdout output and sends it only on newline, file close, or when the buffer is full. And the action of actually sending this buffer is called flush, for one reason, or another.
Setting $|=1 ($| is sometimes called AUTOFLUSH and having it set means „flush stdout buffer on every character printed”) before those actions, as suggested above, changes this behaviour, but seems not related to actual problem you have.
Clearing the screen
In general there is no way to clear the output. In particular, if you redirect script to the file like
perl myscript.pl > somefile.txt
and print something, than this something will land in somefile.txt whatever you do.
When the output is the screen or console, there are many ways, but they depend on what kind of console it is. In many cases sending \r as TLP suggested will do. In other you may use terminal control codes (which are wrapped by curses library).
But there also will be cases when it won't help, for example the one I already mentioned (when you output to the file) or when you use some non-conformant console (frequent case is running script from some text editor or IDE).
So, to summarize:
if you really need to backtrack the output, reconsider your design,
if you are writing some textual progress bar or sth similar for interactive script, use \r or consider moving to Curses or maybe Term::Screen. Or check higher-level available modules like Term::ProgressBar