On 3/12/07, Beginner <[EMAIL PROTECTED]> wrote:

When I ask for the filehandle position (tell) it is reporting the
pointer as being a few bytes further along than I expect it to be.

binmode(FH);

while (<FH>) {

If it's a binary file, you shouldn't read it by "lines", which is what
this does. You should probably use the read function instead; that
will let you specify how many bytes to read at a time. (And is a while
loop the right construct for the operation you're performing?)

        if ($_ =~ /\xFF\xC0/) {  # Start of frame header.
                print "Found start of frame at $start\n";

Where did you put a value into $start?

Finally, it looks as if you're looking into the data of a jpeg/jfif
file. Isn't there a module that will help you do what you want without
mucking around in the raw bytes?

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to