Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: How to embed a tool in my script

by angel_perl (Initiate)
on Feb 14, 2012 at 04:54 UTC ( #953611=note: print w/ replies, xml ) Need Help??


in reply to Re^3: How to embed a tool in my script
in thread How to embed a tool in my script

will the code look like this? after embedding the external script ?

#!/usr/bin/perl use strict; use warnings; my $dir = '.'; #for embeding the mcsearch percompile version my $mcsearch = '/bin/mcsearch'; #to read the PDB files from the directory opendir DIR, $dir or die "Cannot open directory $dir:$!\n"; my @pdb_files = grep { -f $_ && $_ =~ /\.pdb$/ } readdir DIR; closedir DIR; print "Enter the script file"; $a=<>; open(IN,$a) or die; #giving each file as a input to mcsearch for my $file (@pdb_files) { while(<>) { my $content = `$mcsearch "$dir/$file"`; chomp $content; print "Content of $file is $content\n"; } }


Comment on Re^4: How to embed a tool in my script
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://953611]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-12-28 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (181 votes), past polls