in reply to Reading fixed length records

$/=\10; open(F, "foo.txt") || die; $rec=<F>; print length $rec, "\n"; close(F);
Always results in 10, for files of at least 10 bytes. Are you sure your file is 2K long? That's a mighty-big record.

Replies are listed 'Best First'.
Re: Re: Reading fixed length records
by tigervamp (Friar) on May 25, 2001 at 17:37 UTC
    Using your exact code, and a file of 52164 bytes, the beginning of which is:

    This is a test.
    This is a test.
    This is a test.
    This is a test.This is a test.
    This is a test.
    This is a test.
    ...

    I always get 52164, not 10.

    tigervamp