- or download this
my $bufflen = 4 * 1024; #or w/e
...
$result = read ( IN, $buffer,
$bufflen-length($buffer), length($buffer) );
} while ( $result && ( length($buffer) < $bufflen ) );
- or download this
my $newline = "\n"; #or some other unique record separator
...
## this is important: prefix the remainder before next chunk
$buffer = $remainder;
- or download this
$buffer .= <IN>;
- or download this
foreach my $regex (@conversions) {
my @results = ( $buffer =~ s/$regex->{from}/$regex->{to}/g );
...
}
## and do whatever with the result
print OUT $buffer;