On Thursday, December 09, 2010 22:11:25 Amadeus W.M. wrote: > I have a binary file with data. Each block of 48 bytes is a record. See perlfunc(1) and the sysread() Perl builtin. The easiest way to do this would be to loop over calls to sysread() that specify 48 characters. Here's the whole thing: use warnings; use strict; exit unless @ARGV; foreach my $file (@ARGV) { open my $fh, $file or die "can't open $file: $!\n"; my ($rc, $rec); while ($rc = sysread($fh, $rec, 48)) { # do something with $rec } die "read failed: $!\n" unless defined $rc; } > I want to extract the first 8 bytes within each record. substr $rec, 0, 8 -- Garry Williams -- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines