Link to home
Start Free TrialLog in
Avatar of str8dn
str8dnFlag for Afghanistan

asked on

Direct memory manipulation from perl

We have a runtime databank of addresses that are currently accessed with c-programs.  I am hoping to gain the functionality of PERL in several portions of the project that are not time-critical.   Is it possible to have perl directly read and edit this memory bank similarly to what c does?  

For example, I would need to be able to pass a perl script a list of addresses, and then have the script read the existing data from the RAM.  Also, if new variables were created, they would have to be then placed in specific/ newly dedicated locations.  (There is aof course a memeory tracking scheme already in place...)

One might suggest "simply" embedding perl into C, and have C handle the addressing, but I was hoping for a more direct route.  For some reason I can successfullly embed perl in Windows and in several Unix system (inc. Linux), but have been unsuccessful on Onyx (SGI) and Cygwin - the examples in perlembed are unresponsive.
Avatar of str8dn
str8dn
Flag of Afghanistan image

ASKER

A further example will probably help...

Say I use C code to create a variable called var1:

double *var1
var1 = (double) malloc (2000);

If I know the address in RAM where the 2000 bit value for val1 is stored, is there a way to acces the data via a PERL script?
Reading var1 with a c-program, and then passing the values is an option, but I was hoping to find a more elegant solution...

Thanks,

str8dn
ASKER CERTIFIED SOLUTION
Avatar of jmcg
jmcg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of str8dn

ASKER

I will take a look, thanks.

str8dn
Avatar of str8dn

ASKER

Thanks for the info.  After looking over it I have decided another, less intensive route, will give me closer to what I really want, with protability to boot.

Thanks again,

str8dn