in reply to Re^2: Darwin and File::HomeDir
in thread Darwin and File::HomeDir

warning: an integer can be a negative number :/

I actually suggested "warning: the return value can be negative", and I have indeed done that in situations where people tended to assume only positive numbers could be returned.

I doubt a patch to File::HomeDir documentation is going to have an impact.

I agree, but there's not much else that can be done. The only other alternative is to convince OS vendors not to use spaces in the paths to user home dirs.

Seems backwards to me.

Trying to impose limits on the user to kowtow to broken some modules sounds backwards to me.

Trying to convince OS vendors to change their practices to address bugs in modules sounds backwards to me.

Replies are listed 'Best First'.
Re^4: Darwin and File::HomeDir
by Anonymous Monk on May 21, 2011 at 00:16 UTC
    I agree, but there's not much else that can be done. The only other alternative is to convince OS vendors not to use spaces in the paths to user home dirs.

    But why should spaces in the paths be a problem?

      There's no should about it. They are causing problems (according to the OP).
        Yes, those are bugs in broken modules. How is that an OS vendor problem?
Re^4: Darwin and File::HomeDir
by Anonymous Monk on May 21, 2011 at 00:36 UTC
    Trying to impose limits on the user to kowtow to broken some modules sounds backwards to me.

    How is requiring users posses some common knowledge, trying to impose a limit on users?

    This is the synopsis for http://search.cpan.org/~adamk/File-HomeDir-0.97/lib/File/HomeDir/Darwin/Carbon.pm

    use File::HomeDir; # Find directories for the current user $home = File::HomeDir->my_home; # /Users/mylogin $desktop = File::HomeDir->my_desktop; # /Users/mylogin/Desktop $docs = File::HomeDir->my_documents; # /Users/mylogin/Documents $music = File::HomeDir->my_music; # /Users/mylogin/Music $pics = File::HomeDir->my_pictures; # /Users/mylogin/Pictures $videos = File::HomeDir->my_videos; # /Users/mylogin/Movies $data = File::HomeDir->my_data; # /Users/mylogin/Library/App +lication Support
    So what are you talking about?

    Trying to convince OS vendors to change their practices to address bugs in modules sounds backwards to me.

    What? Who suggested trying to convince OS vendors anything?

      How is requiring users posses some common knowledge, trying to impose a limit on users?

      What are you talking about? The user shouldn't have to even know that File::HomeDir is being used by one of his scripts, much less possess some "common knowledge" about it.

      Preventing the module from working on systems with spaces is imposing limits on the user.

      Requiring the user to create an alternative home directory is imposing limits on the user.

      So what are you talking about?

      What can be done about the modules that don't handle the space being returned by my_data.

      Who suggested trying to convince OS vendors anything?

      Me. Or rather, I was suggesting that it would be silly do to so. It's the only way I see that File::HomeDir could return something without spaces.

        What are you talking about? The user shouldn't have to even know that File::HomeDir is being used by one of his scripts, much less possess some "common knowledge" about it.

        If you think that, then why you suggest a patch for File::HomeDir documentation?

        The user being discussed in this thread is the code writer who writes

        use File::HomeDir;
        and then his code breaks because File::HomeDir returns a path with spaces in it.

        File::HomeDir is working as designed. There is no bug in File::HomeDir.