running a compiled program in perl

B

Bob Then

How can I run a compiled C program in Perl I tried using

use Shell(prog);
prog("","");

and

use Shell(./prog);
prog("","");

and

use Shell(prog);
../prog("","");

but non of them worked.
I know the first one didn't work because it needs the ./ at the start
 
A

A. Sinan Unur

How can I run a compiled C program in Perl I tried using

use Shell(prog);

Did you even bother to read the documentation for the module you are
using?

DESCRIPTION
Caveats
This package is included as a show case, illustrating a few Perl
features. It shouldn't be used for production programs. Although
it does provide a simple interface for obtaining the standard
output of arbitrary commands, there may be better ways of achieving
what you need.


Please read:

perldoc Shell

perldoc -f system

Sinan
 
T

Tad McClellan

Bob Then said:
How can I run a compiled C program in Perl
^^^^^^^^^^

How the program was created is irrelevant.

There are essentially 3 ways to run external programs from within Perl:

perldoc -f system

perldoc -f qx

perldoc -f open


See also:

perldoc -q STDERR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,924
Members
47,464
Latest member
Bobbylenly

Latest Threads

Top