in reply to In place edit and printf

I don't see how your code could work at all. Your regex won't match any of the lines you've shown, so $1 and $2 are going to be empty. You've got TWO format items in your printf(), but you're only supplying ONE item to that format list. And you've got a precedence problem with the ?: operator and addition. Try this:
while (<>) { if (/^(\w+)\s+(\d+)(.*)/) { printf "%s %d %s\n", $1, (exists $disk{$1} ? 0 : ($2+$partition)), + $3; } else { print } }

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart