Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: File::HomeDir strange behavior Perl 5.28

by soonix (Abbot)
on Nov 02, 2018 at 06:59 UTC ( #1225091=note: print w/replies, xml ) Need Help??


in reply to Re^2: File::HomeDir strange behavior Perl 5.28
in thread File::HomeDir strange behavior Perl 5.28

When trying with Strawberry (portable),
perl -MFile::HomeDir -e "print $File::HomeDir::IMPLEMENTED_BY;"
gives me Portable::HomeDir

If I remove/rename said module (...\perl\vendor\lib\Portable\HomeDir.pm), I get the expected File::HomeDir::Windows.

It might make sense for berrybrew to do this locally.

(Update: crossposted to https://github.com/stevieb9/berrybrew/issues/121)

Replies are listed 'Best First'.
Re^4: File::HomeDir strange behavior Perl 5.28
by stevieb (Abbot) on Nov 02, 2018 at 09:34 UTC

    Thanks for the issue report, soonix!

    I'm a bit confused as to what is desired for berrybrew here. Are you wanting berrybrew to point to C:\Users\USER\AppData\Local, or portable_install_path\data?

    What do people thinks makes more sense?

    Since I'm honestly only a Windows user in rare cases (testing my own software, mostly, and, well, developing berrybrew ;), I'm not sure of the benefits of either way.

    In either case, if people thinks it would be better to have an option to return all portable editions in berrybrew back to the default File::HomeDir on each install, I'm all ears. That said, I would make it user configurable via a config file directive, where the current method is default, and the user would have to set a flag to have the Portable functionality removed (and it would be global, occurring after each install of a new instance).

    I suppose I could add a new berrybrew install x.xx -win_home or some such flag as well so that each install could be customized, if you think that makes sense. In any case, it would have to be non-intrusive to the user.

      I think I'd prefer berrybrew removing the Portable::HomeDir by default. However, CPAN and cpanm both use File::HomeDir->my_home, which means it would be difficult to have different configs for different versions. This probably would only be a minor gotcha, but I see the impact would be greater than what I thought when I wrote this. A config directive is definitely a good idea.

        This is exactly why I wanted to hash this out in a public forum, to get as much feedback, criticism and "ohhh, I forgot about that angle!" comments that I can before I make a change.

        I don't like it when I'm too quick to implement something that I'll be kicking myself in the ass for in three months.

        Very good feedback so far here, I appreciate it all.

Re^4: File::HomeDir strange behavior Perl 5.28
by Anonymous Monk on Nov 02, 2018 at 07:24 UTC

    The question is if it will break someway the Perl installation...

      Improbable. Removing Portable::HomeDir might break a script or an application, if that expects File::HomeDir's "portable" behaviour. OTOH having it in effect breaks scripts/apps that expect the "normal" behaviour.

        I agree. People want to use the portable distribution because they want it portable. If I carry a Perl installation around on a memory stick, then it makes sense to have my_data on said stick.

        berrybrew, on the other hand, is targeted at people who want to run different versions of Perl on the same machine. The Perls need to be isolated from each other, but not from the user/OS environment. In this case I would expect the "traditional" Windows implementation, if only because this is how perlbrew does it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1225091]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2019-05-23 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (147 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 18:53 UTC) Welcome new users!