$f is a way too short variable name, just overwrite `$file` since it's original value is never used for anything but modifcation