package Load; #use strict; use warnings; use vars qw ($VERSION @ARRAY_LIST @SEARCH_STRING); our $VERSION=0.10; our @ARRAY_LIST=(); our @SEARCH_STRING=(); sub new { my ($class) = @_; my $self = { _listNames => undef, _search => undef }; bless $self,$class; return $self; } sub listNames { my ($self,$listNames) = @_; $self->{_listNames}= $listNames if defined ($listNames); open(LIST,"$listNames") || die "Error::Cannot load names!!!\n"; #my $buff="./data/buffed.dat"; #open(BUFF,">$buff") || die "Error::Cannot load buffer file!!!\n"; while() { chomp($_); push (@ARRAY_LIST,$_); } } sub search { my ($self,$search) = @_; $self->{_search}=$search if defined ($search); our @SEARCH_STRING=grep(/$search/,@ARRAY_LIST); } sub display { my ($self) = @_; print "\n\nSearching directory ...\n\n"; sleep 2; print "Search Results:\n"; print "=======================================\n\n"; foreach $files (@SEARCH_STRING){ print "$files\n"; } } 1;