angel_perl has asked for the wisdom of the Perl Monks concerning the following question:
I am very new to perl programming and i was trying to write a program which read multiple files (*.pdb) from a folder and then i want those files should be read by a tool. So, how can i incorporate the tool in this script. I have the precompiled version of the tool.
use strict; my $directory = "c:\\"; opendir( DIR, $directory ) || die "Unable to open directory - $!\n"; my @files = grep /\.pdb/, readdir( DIR ); closedir( DIR ); foreach my $file (@files) { open( FH, "$directory\\$file" ) || die "Unable to open $file - $!\n"; while( <FH> ) { } close( FH ); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to embed a tool in my script
by McDarren (Abbot) on Feb 12, 2012 at 07:19 UTC | |
by angel_perl (Novice) on Feb 12, 2012 at 13:43 UTC | |
by McDarren (Abbot) on Feb 12, 2012 at 16:48 UTC | |
by angel_perl (Novice) on Feb 14, 2012 at 02:49 UTC | |
by McDarren (Abbot) on Feb 14, 2012 at 13:54 UTC | |
by angel_perl (Novice) on Feb 14, 2012 at 04:54 UTC | |
by angel_perl (Novice) on Feb 14, 2012 at 13:55 UTC | |
Re: How to embed a tool in my script
by zentara (Cardinal) on Feb 12, 2012 at 09:48 UTC |