in reply to Re^2: Passing variable to if statement
in thread Passing variable to if statement

I think OP's original code is fine in this regard.

Whoops, I missed the missing or die in the second open. Nevermind that sentence.

Replies are listed 'Best First'.
Re^4: Passing variable to if statement
by PerlSufi (Friar) on Jul 16, 2014 at 21:45 UTC
    Agreed, I didn't really mean  use autodie; was a best practice.. should have clarified and used the  or die instead :p