in reply to filehandle

The interpreter is a little confused -- it's not picking up "> foo" as arguments for the $fh->open method call. Wrap it in parenthesis to make it all clear: if ($fh->open("> foo")) { Works for me!