Hi,
I want to write a program in perl which will pass function parameters to a C++ .exe file and run the exe file with these parameters

Recommended Answers

All 2 Replies

look intot these operators/functions and decide which is best for your purposes:

system - runs a program but doesn't return program output to the perl script. Returns exit status, if any, of run program instead.

exec - runs a program but exits the perl program as soon as it's called

`` (backtiks) - runs a program and returns program output back to the perl script

qx// - same as backtiks

whatabout pipes?

open my($what), "| bin/what.exe -p whatever";
close ($what);

you should be able to read back live/streaming status if the program sends it... and you can definately send a bulk stream of data to the program; if the program wants to receive it.

EDIT/PS:
be careful you don't do:

open my($what), "> bin/what.exe -p whatever";
close ($what);

unless you're not concerned about losing the exe =P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.