cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:

I was playing with turnstep's single pixel gif generator, when I hit this error:

Character in "c" format wrapped

This is a new one on me, and I can't find it in The Camel. Can anyone enlighten me? The amended code in question is:

print "Content-length: 43\nContent-type: image/gif\n\n"; printf ("GIF89a\1\0\1\0%c\0\0%c%c%c\0\0\0%s,\0\0\0\0\1\0\1\0\0%c%c +%c\1\0;",144,0,0,0,pack("c8",33,249,4,5,16,0,0,0),2,2,4);

I assume it's in the pack statement somewhere, but pack is scary voodoo to me :)

cLive ;-)

Replies are listed 'Best First'.
Re: "Character in "c" format wrapped" (C)
by tye (Sage) on Mar 19, 2004 at 20:40 UTC

    "c" is signed. 249 is too big for a signed byte. "C" is for unsigned, use that instead.

    Instead of looking in the Camel, add "-Mdiagnostics" or "use diagnostics" if you don't know what an error or warning means (or look in your local copy of lib/pod/perldiag.pod or "perldoc perldiag"). For example: 5.8.0's.

    - tye        

      The diagnostics pragma doesn't seem to spit anything out for this particular warning.

Re: "Character in "c" format wrapped"
by tachyon (Chancellor) on Mar 19, 2004 at 20:53 UTC

    I don't know but I thought a single pixel gif was 77 bytes. See dws's On-demand single-pixel GIFs for more. Unless you need to change colours across the entire you are best to use these sorts of things to generate static gifs that you just link to as required.

    cheers

    tachyon

Re: "Character in "c" format wrapped"
by Anonymous Monk on Mar 19, 2004 at 20:42 UTC

    Works fine for me... windows xp pro, perl 5.8.2

      *cough* oops, i forgot the warnings and strict