Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

  (email not shown publicly)

Journal of Alias (5735)

Wednesday May 17, 2006
10:05 PM

File::HomeDir API incompatible change soon

[ #29628 ]

Well, moved into new Sydney place ok. All the hard drives survived the moved ok.

The new place is a totally stereotypical geek share house.

"Hi, come on in. So, the switch is over there, and there's wireless, but a bit weak upstairs. The two X-Boxs are over there. Oh, and we're ordering takeout"

Yep :)

Should be a great place to settle back into living in Sydney for 6 months or a year or something.

In CPAN news, we cracked the big 10,000 modules WAY faster than I expected, thanks to someone unleashing a dozen new Kwiki modules on the world. And thanks to everyone else that released as well.

In addition, I've realised that I'm going to have to change the File::HomeDir API, seeing as there are some situations where the user has nothing whatsoever that could be construed as a "home directory".

So all methods are going to need to change to return undef in this case. Note that this doesn't change the fact that File::HomeDir will -d and confirm a directory exists before returning it, it just means you are going to need to work out for everything that uses it how to deal with no-homedir situations, and this will force people into it.

I've filed about 15 bugs with the people that use it I can detect, so they (and you) have a couple of months before I make the actual change.

Hopefully there won't be too much trouble, as currently File::HomeDir just dies in the situations that have no home directory.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • How is returning undef better than dying? It sounds like a step backward to me. Is there a reason for that choice?
    • A die would indicate an exception, something we don't expect to happen.

      In fact, File::HomeDir already has a number of these in it. Generally, it's things like failing to find a directory where it is expecting one. If someone hacked their OS X directories to something unusual, you might see it.

      However, as I push outwards to try and cover more platform and situations, I'm finding that lack of a home directory is much much more common than I had thought (or than the original author thought as well I suspect).