in reply to unable to open existing file after trying to open a non-existing one

You're checking $! without checking whether the open() failed! From the documentation:

This means that the value of $! is meaningful only immediately after a failure:

if (open(FH, $filename)) { # Here $! is meaningless.

Liz

  • Comment on Re: unable to open existing file after trying to open a non-existing one
  • Download Code

Replies are listed 'Best First'.
Re: Re: unable to open existing file after trying to open a non-existing one
by monk_of_gaia (Initiate) on Sep 23, 2003 at 16:00 UTC
    ok, thanks :)