progress bar
- From: sprotsman@xxxxxxxxx (Protoplasm)
- Date: Tue, 28 Oct 2008 17:44:56 -0700 (PDT)
I want to implement a status/progress bar in my little piece of find
file code. I've looked at Term::ProgressBar and Smart::Comments and
I've tried many many different examples. But I cannot figure out how
to implement either of the two into my code. Any pointers/tips/ideas
would be appreciated.
Here is my code:
#!/usr/bin/env perl
## This finds all directories named AesTest in a user's home
directory.
# It ignores hidden directories and other mounted file sytems,
like .gvfs.
#
use File::Find();
eval("use File::HomeDir;");
die "[err] File::HomeDir not installed. Use \"perl -e \"use CPAN;
install \
File::HomeDir;\"\" to install \n" if $@;
use strict;
use warnings;
use 5.010;
my $home_directory = File::HomeDir->my_home;
my $search_for = "AesTest";
find_directories();
exit;
sub find_directories {
print "\nLocating directory...\n";
File::Find::find(\&want_directory, $home_directory);
}
sub want_directory {
my $dev = ( lstat )[ 0 ];
($File::Find::prune |= ($dev != $File::Find::topdev) ||
($File::Find::name) =~ m!/\.! && return);
/^$search_for/ && say "$File::Find::name";
}
.
- Prev by Date: Re: Reading a list of numbers from a file into a array
- Next by Date: Re: Can't download and install Spread***::WriteExcel module on WindowsXP
- Previous by thread: Can't download and install Spread***::WriteExcel module on WindowsXP
- Next by thread: LWP::Useragent htaccess does not work
- Index(es):