| Next | Lightweight Databases | 41 |
while (read($fh, my($rec), 64) == 64) {
...
}
Alternative: Starting in 5.6.0, you may say
sub find_user {
my ($fh, $user) = @_;
seek $fh, 0, SEEK_SET;
local $/ = \64;
while ($rec = <$fh>) {
my (@field) = unpack "A8 A5 A13 A20 A18", $rec;
next unless $user eq $field[0];
return @field;
}
return;
}
| Next | ![]() |
Copyright © 2003 M. J. Dominus |