Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Passing a structure from C to Perl

by bliako (Monsignor)
on Mar 23, 2018 at 13:17 UTC ( [id://1211606]=note: print w/replies, xml ) Need Help??


in reply to Passing a structure from C to Perl

An idea, building on the JSON params string: from within C serialise a perl object which will contain all params you want and get() methods to obtain the params. Then either write that to file and have perl read it and de-serialise/resurrect it or hardcode it into the perl script if you create the script on-the-fly as in my previous comment.

JSON is a way to encode a data structure. Whereas the serialised perl object above goes a lot further with error-checking logic, functions, debugging messages etc. BUT it also introduces a lot of security risks; the usual eval() concerns.

Relevant Kraftwerk lyrics:

  • Wir fahr'n fahr'n fahr'n auf der AutoInfobahn
  • I'm the operator with my pocket calculator
  • By pressing down a special key, it plays a little melody

bliako

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1211606]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-24 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found