Yes, this seems like what I want to do. I would like to open the file using the external software program, run one command on it using the external software, and then save it.
The software like I said before is not widely known. What happens is the drill program is made through a main CAD software system, then post processed with PERL scripts, then the file is machine ready. However, now we have a new drill machine that needs to run the file through another software to make it a .mwd file, which would then make it machine ready for this new drill machine. I will play around with the pipe operator more and see what happens. Thanks <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Mark" <[EMAIL PROTECTED]> writes: > >> I have looked at the perlopen tuturial, but I am still not sure how to >> accomplish this. I just can't believe that it is as easy as, >> open(INFO, "datafile") || die("can't open datafile: $!"); In other >> words how does it know what software to open the "datafile" with? >> If I could get a look at sample code of this, that would be a HUUGE help. > > Maybe you are looking for the pipe operator used in an `open' > > ./mynewscript.pl filename > > ## Pass in file name to be read > my $Fname = shift; > > ## Give perl the address and program name of needed program > my $cmd = '/path/to/SoftwareThatRunsProgram'; > > ## Open file with the needed command <$cmd> .. > ## Note pipe operator (|) after $cmd > open(CMD,"$cmd|") or die "Cannot open $mcd; $!'; > while(CMD){ > ## Code here to manipulate lines that are being read > [...] > } > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
