I am trying to print progress in % in command prompt. But it is not working properly.
I want to print the progress as :: Status 10% Completed when 20% will complete
You can do something like this:
use strict; use warnings; use Time::HiRes qw(usleep); local $| = 1; my @nums = 1 .. 20; foreach my $c (@nums) { print "$c"; usleep(100000); print ("\b" x length($c)); } print "\n";