Help for this page

Select Code to Download


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