/ Published in: Perl

This is used to recurse through a directory and perform some action on each file
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/user/bin/perl -w use strict; use File::Find; my @DIRLIST = ("c:\\scratch", "c:\\sukanta\\scratch"); my @table_list; # Returns the SBRRES_* tables, there can be duplicate tokens sub get_tables_from_process { # read the input file my @tokens; while(<FILE>) { } # find the unique tables } # # This function will be called for each file by the find function # sub process_file { my $fname = $_; } } find(\&process_file, @DIRLIST); my %unique = (); foreach my $item (@table_list) { $unique{$item} ++; } foreach my $item(@table_list) { }
Comments
