Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Embed GIF in perl source?

by mdillon (Priest)
on Dec 07, 2000 at 03:31 UTC ( [id://45388]=note: print w/replies, xml ) Need Help??


in reply to Embed GIF in perl source?

this topic has come up a couple times in the past. Check out this: More on hex pack/unpack.

Replies are listed 'Best First'.
(bbq) Re: Re: Embed GIF in perl source?
by BBQ (Curate) on Dec 07, 2000 at 12:07 UTC
    And check out Hex Embedded Images as well...
    # hex up your image open IMG, "$ARGV[0]" or die "Couldn't open $ARGV[0]: $!\n"; binmode(IMG); undef $/; $image = <IMG>; $hex = unpack("H*", $image); close IMG; while ($txt = substr($hex,0,32,'')) { print "'$txt'\n"; }

    # print your hexed stuff out print "Content-type: image/gif\n\n"; print Image(); sub Image { my $image = '4749463839610f001000a2ff00848684' . 'dfe0dfc6c7c6c0c0c000000000000000' . '000000000021f90401000003002c0000' . '00000f00100040034048baacf3608049' . 'a98824ca0aae78d9b375a4164a92470e' . '016a8dde10721c48dfc029ee528b0ac0' . 'e06717121a8132cd6729b4ed8cc4c891' . '97a45a09b286569100003b00'; return(pack("H*",$image)); }


    #!/home/bbq/bin/perl
    # Trust no1!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found