> -----Original Message----- > From: Thomas Evangelidis [mailto:teva...@gmail.com] > Sent: Thursday, February 19, 2009 08:27 > To: beginners@perl.org > Subject: calling a program from a perl script and redirecting > to output to a file > > Dear Perl programmers, > > I want to run a program from a perl script and redirect the > its output to a > file. The programs is called apbs and takes 1 argument, so in > unix shell I > 'm simply typing the following: > > $apbs input.in >$ output.txt # '>' doesn't work here Unless the output is trully large, I use somehting like:
my @myout = `$apbs input.in`; Then I parse what is in the array. I have number of processes that I do this way. If you have any questions and/or problems, please let me know. Thanks. Wags ;) David R. Wagner Senior Programmer Analyst FedEx Freight 1.719.484.2097 TEL 1.719.484.2419 FAX 1.408.623.5963 Cell http://fedex.com/us > > When using the system function I get an error. Does anyone know how to > achieve that in perl. > > thanks in advance, > Thomas > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/