# ----------------------------------------------------------------------------- # File name : sort_list.pl # Location : FRA # Last edited by : # Last Checkin : 11.08.2009 # Revision : 0.1 # ----------------------------------------------------------------------------- # History: # # # 11.08.2009 first version # # ----------------------------------------------------------------------------- # # # # Last change: 11.08.2009 XXX # ################################################################################ # # # ------------------------------------------------------------------ # Loaded Modules # ------------------------------------------------------------------ use strict; use warnings; use threads; use threads::shared; # # # ------------------------------------------------------------------ # File open # ------------------------------------------------------------------ open (OUT, "new(\&DotPrintThread, $Interval); sub DotPrintThread { my ($Interval, @Trash) = @_; use IO::Handle; autoflush STDOUT 1; my $IntervalCount=0; print "\n\tpls. wait getting data "; while ($StopDotPrintFlag != 2) { if ($StopDotPrintFlag == 1) { print STDOUT "."; } $IntervalCount++; sleep $Interval; } return $IntervalCount; } # # # ------------------------------------------------------------------ # start search # ------------------------------------------------------------------ my %keys; while (my $line=) { for my $string (@string) { $keys{$1}++ if($line=~ /,($string)/); } $StopDotPrintFlag = 1; #Stop threads } # # # ------------------------------------------------------------------ # get search result # ------------------------------------------------------------------ while (my ($key,$val)= each(%keys)) { print "\n$key = $val\n"; } # # # ------------------------------------------------------------------ # File close # ------------------------------------------------------------------ close OUT; # # #**************************** # End of Script #****************************