in reply to How do I slurp an arbitrary number of bytes from a file?

You can use read as merlyn points out, but you can also do it by setting the input record separator to a scalar reference.

{ local $/ = \512; while (<FILE>) { # process the 512 bytes you have in $_ } }
--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me