in reply to Re^3: Reading Directory and getting pattern from a file
in thread Reading Directory and getting pattern from a file
Sorry, I was not aware of your name. Your tag line is cool. :) So far I have written this much of code. The power directory has two directories and in those directories. There are 130 sub directories for each directories. I want to go to each sub directory and get a pattern from a text file in that directory. I am stuck with how to check directories and get that perticular pattern. mdp is a pattern. Your help will be greatly appreciated.
------------------------------------------#!usr/bin/perl; use strict; use warnings; $| = 1; sub main{ my $directory = '/nfs/fm/stod/stod1031/w.eakanoje.101/power/'; opendir (DIR, $directory) or die "Cannot open directory $directory" +; # while (my $file = readdir(DIR)){ # next if($file =~ m/^\./); # print "$file\n"; # } my @out = glob("mdp*"); print "@out\n"; } main();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Reading Directory and getting pattern from a file
by SuicideJunkie (Vicar) on Feb 10, 2015 at 21:06 UTC | |
|
Re^5: Reading Directory and getting pattern from a file
by soonix (Chancellor) on Feb 11, 2015 at 11:27 UTC | |
by Eshan_k (Acolyte) on Feb 12, 2015 at 00:27 UTC |