Help for this page
my %current_inventory; while (<RECORDS>) { ... } close(RECORDS) or die $!; # now inventory is in memory as a hash, can look things up directly
while (<NEW_RECORDS>) { my @ary = split ':'; ... } close(NEW_RECORDS) or die $!; # now update is done, save with proper file locking