Skip to content

Instantly share code, notes, and snippets.

@nipotan
Created February 26, 2010 10:51
Show Gist options
  • Save nipotan/315629 to your computer and use it in GitHub Desktop.
Save nipotan/315629 to your computer and use it in GitHub Desktop.
it's useful if you don't want someone to touch your script without your approval
use strict;
use Term::ProgressBar;
use Time::HiRes qw(sleep);
$SIG{INT} = sub {};
my $progress = Term::ProgressBar->new({
name => 'deleting all data',
count => 1000,
ETA => 'linear',
});
$progress->minor(0);
for my $i (0 .. 1000) {
$progress->update($i);
sleep rand(0.3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment