I am trying to update the progress of my Perl script on the terminal. The output looks something like this
Progress: ||||||||| [46%]
The progress keeps on getting updated until it reaches 100%. This is being done by printing "\r" after updating the progress. I wish to update multiple lines at the same time, how can it be done? The expectation is something like this
Progress: ||||||||| [46%] Run-time: 100sec
After some progress(and or time) I wish to update it like this
Progress: |||||||||| [50%] Run-time: 150sec
I tried printing "\r" two times to go to the previous line. But it didn't work.
I found similar questions (here and here), but they were answered for Python using modules. Mine is a Perl script, and I am not preferring to use external modules.