You could use Perl's built in UU-encoding, built into
pack/
unpack, using the
"u*" template, to convert any binary string to a text string of limited line length.
You can use the following code to load the file and generate the Perl code to set the image string, which you can then include in your script:
{
open IN, "tsl_logo1.gif";
binmode IN;
local $/;
print "\$image = unpack 'u*', <<'_END_';\n";
print pack "u*", <IN>;
print "_END_\n";
}
Of course, that requires that you can just set an image in a UI from a binary string, instead of loading it from a file. I don't know what module you're using for the UI, so you'll have to check that yourself.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.