Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^6: How to execute external programs from perl script

by Anonymous Monk
on Mar 04, 2011 at 11:30 UTC ( [id://891419]=note: print w/replies, xml ) Need Help??


in reply to Re^5: How to execute external programs from perl script
in thread How to execute external programs from perl script

I have a query on perl system command. I would like to learn from perl monks how to place variables inside system command ?

In the script below, program "phylip" generates two output files and asks user to name them. I want to name the first output file as "blah.txt" and second as "blah.xls".

$filename ="blah.doc"; .... .... $filename =~ s/\.doc//; system 'echo "$filename.txt\n$filename.xls\n" | phylip';

(blah.doc is the input file, I use at the beginning of a long script)

when I run above script, "phylip" doesn't recongnize either of the filenames. Can anyone advise me, how to go about doing this ?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found