in reply to Re: if statement/uninitialized value
in thread if statement/uninitialized value

The Use of uninitialized value message is only a warning[1] and since warnings are merely advisory your program shall continue on it's merry way.
if the file doesn't exist it shouldn't run the if statement, right?
Right. So the code to be executed if the given condition is true won't be executed because -e undef will always return false.
if it doesn't run the if statement i shouldn't get the error
But the condition still has to be tested, so $info still has to be evaluated and the warning will be raised if $info hasn't been initialised at that point.
HTH

_________
broquaint

[1] for more info on warnings in perl see the perllexwarn and perldiag manpages

  • Comment on Re: Re: if statement/uninitialized value