chmod $mode, '$filename' or die "can't chmod: $!";