nop has asked for the wisdom of the Perl Monks concerning the following question:
That code above seems to work, and runs instantly on a winnt & indigo perl box.#!c:\apps\perl\bin\perl.exe use strict; my $hex = '47494638396101000100e3000000000' . '0bf000000bf00bfbf000000bfbf00bf' . '00bfbfc0c0c0808080ff000000ff00f' . 'fff000000ffff00ff00ffffffffff21' . 'f9040100000f002c000000000100010' . '0400402f045003b'; my $gif = pack("H*",$hex); binmode(STDOUT); print "Content-type: image/gif\n"; print "Content-length: 85\n"; print "\n"; print $gif;
This second version runs extremely slowly on the same system, taking 3 or 4 seconds to load the (invisible) image.#!c:\apps\perl\bin\perl.exe use strict; my $hex = '47494638396101000100e3000000000' . '0bf000000bf00bfbf000000bfbf00bf' . '00bfbfc0c0c0808080ff000000ff00f' . 'fff000000ffff00ff00ffffffffff21' . 'f9040100000f002c000000000100010' . '0400402f045003b'; my $gif = pack("H85",$hex); binmode(STDOUT); print "Content-type: image/gif\n"; print "Content-length: 85\n"; print "\n"; print $gif;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pack, 1 pix gif, and mod_perl speed
by pfaut (Priest) on Jan 29, 2003 at 03:39 UTC | |
|
Re: pack, 1 pix gif, and mod_perl speed
by cees (Curate) on Jan 29, 2003 at 04:42 UTC | |
|
Re: pack, 1 pix gif, and mod_perl speed
by shotgunefx (Parson) on Jan 29, 2003 at 07:15 UTC |