On 28-jun-2006, at 19:33, Austin Ziegler wrote:

>
> Better, from my perspective:
>
>  raise u"Not PNG." unless @top[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a"
>
> That way, I *mark* the strings for which I want Unicode format. The
> encoding pragma makes it hard to do mixed content files.
>
> (This example, by the way, is *specifically* artificial, but the code
> involved is real. It's image matching code with error messages if
> there's a mismatch.)

Please no. Please please no.

What about:

raise "Not PNG." unless @top.bytes[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a"

-- 
Julian 'Julik' Tarkhanov
please send all personal mail to
me at julik.nl