system("clear"); has asked for the wisdom of the Perl Monks concerning the following question:
I am building a simple timer script and I wanted to make a loading bar that corresponded to the time. But unfortunately I can't get it to print without making a new line Thanks... I'm not to good a perl
#!/usr/bin/perl use Math::Round qw(:all); print "Minutes?\n"; $minutes = <>; chop $minutes; $timeleft = 60*$minutes; system("clear"); while($timeleft >= 0){ $devided = $timeleft/60; $rounded = nlowmult (1, $devided); $seconds = $timeleft-($rounded*60); print "$rounded minutes and to $seconds seconds left\n"; $ran = 30/$timeleft; $count = $ran*$timeleft; while ($count >=0 ){ print "#"; $count--; } sleep (1); system("clear"); $timeleft--; } print "TIME UP!!!!!!\a"; while (1){ print "\a"; print "\a"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing without a newline?
by davido (Cardinal) on Apr 19, 2014 at 05:51 UTC | |
by system("clear"); (Initiate) on Apr 19, 2014 at 16:28 UTC | |
|
Re: Printing without a newline?
by AnomalousMonk (Archbishop) on Apr 19, 2014 at 01:22 UTC | |
|
Re: Printing without a newline?
by Desdinova (Friar) on Apr 19, 2014 at 01:00 UTC | |
by system("clear"); (Initiate) on Apr 19, 2014 at 01:02 UTC |