Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Embedding an Executable file in Perl program

by peacemaker1820 (Pilgrim)
on Mar 26, 2003 at 18:13 UTC ( [id://246027]=note: print w/replies, xml ) Need Help??


in reply to Re: Embedding an Executable file in Perl program
in thread Embedding an Executable file in Perl program

Thanks for the answer but I do not understand a couple of things.
What does the sub getexe() do, what are those wierd characters, what should I put in the getexe() because u specified  ##(more data here); ?

Thanks

Replies are listed 'Best First'.
Re: Re: Re: Embedding an Executable file in Perl program
by meetraz (Hermit) on Mar 31, 2003 at 22:51 UTC
    Your original request asked how to "embed an executable file". The easiest way to do this is to convert your binary executable into a text-based string. One such way is to escape each byte using \xNN syntax. If your binary executable is 30k, you will have a string made up of 30,000 variations of "\xNN". The getexe() function is just returning this binary data to the main part of the program so it can be extracted to disk. You don't have to do it this way - I just thought it made it easier to read. I put the ##(more data here) in there because the post would have been really huge if I posted all 30k. Your executable code will be different anyway.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-03-29 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found