in reply to Re^2: update values in one file from another
in thread update values in one file from another

If I wanted to change the logic of the above code so all values not in $fed{1} were incremented by 1 instead , how would I do this ?
I tried doing this
local @ARGV = ('file1.txt'); local $^I = '.bak'; while (<>) { m/^(\w+)\s+(\d+)$/; printf "$1\t%d\n", not exists $fed{$1} ? $2+1 : 0; }
This only works the first time it's run, after that everything that isn't in $fed{1} is always only set to 1.
I was trying to get it to increment all other values by 1 each time and set the $fed{1} values to 0