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 $_ } }
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: How do I slurp an arbitrary number of bytes from a file?
by davorg
in thread How do I slurp an arbitrary number of bytes from a file?
by donfreenut
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |