-
-
Save polettix/81f2f778d34c12379a627610c2df4059 to your computer and use it in GitHub Desktop.
Term::Twiddle demonstration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.024; | |
use warnings; | |
use experimental qw< postderef signatures >; | |
no warnings qw< experimental::postderef experimental::signatures >; | |
use Time::HiRes 'sleep'; | |
use FindBin '$Bin'; | |
use lib "$Bin/local/lib/perl5", "$Bin/lib"; | |
$|++; | |
use Term::Twiddle; | |
my $spinner = Term::Twiddle->new; | |
print 'wait for it... '; | |
$spinner->start; | |
system('sleep 5'); | |
$spinner->stop; | |
say ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.024; | |
use warnings; | |
use experimental qw< postderef signatures >; | |
no warnings qw< experimental::postderef experimental::signatures >; | |
use Time::HiRes 'sleep'; | |
use FindBin '$Bin'; | |
use lib "$Bin/local/lib/perl5", "$Bin/lib"; | |
$|++; | |
use Term::Twiddle; | |
my $spinner = Term::Twiddle->new; | |
$spinner->thingy([ | |
'| |', | |
'|~ |', | |
'|~~ |', | |
'|~~~ |', | |
'|~~~~ |', | |
'|~~~~~ |', | |
'|~~~~~~ |', | |
'|~~~~~~~ |', | |
'|~~~~~~~~ |', | |
'|~~~~~~~~~ |', | |
'|~~~~~~~~~~ |', | |
'|~~~~~~~~~~~ |', | |
'|~~~~~~~~~~~~|', | |
'| ~~~~~~~~~~~|', | |
'| ~~~~~~~~~~|', | |
'| ~~~~~~~~~|', | |
'| ~~~~~~~~|', | |
'| ~~~~~~~|', | |
'| ~~~~~~|', | |
'| ~~~~~|', | |
'| ~~~~|', | |
'| ~~~|', | |
'| ~~|', | |
'| ~|', | |
]); | |
print 'wait for it... '; | |
$spinner->start; | |
system('sleep 7'); | |
$spinner->stop; | |
say ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment