in reply to Re: Uninitialized filehandles not as advertised?!
in thread Uninitialized filehandles not as advertised?!
... Why do you need a sub at all?
This code is part of an abstraction layer. Multiple programs will call this routine, which during the prototyping phase will just scan a flat file, but in future may use DBM or SQLite. As with abstraction layers in general, we won't want at that point to go back and change all of the open() calls to deal with database setup and take down.
Returning undef would be better than returning an empty string.
I am lazy and prefer to use the simpler test with || instead of having to get my return value, separately test it for defined(), and only then start using it.
TMTOWTDI and I like it that way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Uninitialized filehandles not as advertised?!
by ikegami (Patriarch) on May 27, 2008 at 09:10 UTC |