http://qs1969.pair.com?node_id=345050


in reply to doing a search and replace on a large file

Here's one way...

#!/usr/bin/perl -w use Tie::File; use strict; my @ry=(); tie @ry,"Tie::File","mybigfile" or die "mybigfile:$!"; @ry = grep /mypattern/,@ry; untie @ry;

Please note: that was off the top of my head and untested.