Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

File::HomeDir methods my_dist_data and my_dist_config do nothing on Win32

by Intrepid (Deacon)
on Apr 07, 2021 at 22:49 UTC ( [id://11130977]=perlquestion: print w/replies, xml ) Need Help??

Intrepid has asked for the wisdom of the Perl Monks concerning the following question:

<meta http-equiv="Content-type" content="text/html;charset=cswindows1252">

Hello good monks. I am trying to manage data associated with perl programs and these subroutines from File::HomeDir would seem to be a good starting place, but they do nothing (I am running StrawberryPerl on Windows 10). They return "undefined".

Both subs rely on my_data which looks like this:

sub my_data { $IMPLEMENTED_BY->can('my_data') ? $IMPLEMENTED_BY->my_data : Carp::croak("The my_data method is not implemented on this pla +tform"); }
I'd expect that if not implemented, the code would croak, which it does not do. Can anyone shed light on this module? Thanks in advance.

[localtime:// PUT ISO-8601 TIME HERE followed by UTC]

Examine what is said, not who speaks.
Love the truth but pardon error.
Silence betokens consent.
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re: File::HomeDir methods my_dist_data and my_dist_config do nothing on Win32
by swl (Parson) on Apr 07, 2021 at 23:07 UTC
Re: File::HomeDir methods my_dist_data and my_dist_config do nothing on Win32
by Discipulus (Canon) on Apr 08, 2021 at 10:49 UTC
    Hello Intrepid,

    I read in the docs:

    > Returns the directory path as a string, undef if the current user does not have a data directory, or dies on error.

    I get the same result as swl but I suspect both are running portable edition of strawberry so we dont get For example, on Unix you get ~/.foo and on Win32 you get ~/Local Settings/Application Data/.foo as the docs says.

    perl -MFile::HomeDir -E"say File::HomeDir->my_data" C:\EX_D\ulisseDUE\perl5.26.64bit\data

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      Thanks Discipulus and swl. I am not running the portable edition of StrawberryPerl. I have not modified $IMPLEMENTED_BY (swl). Well, I guess I'll keep poking at it (looking at the code).
      never
      Examine what is said, not who speaks.
      Love the truth but pardon error.
      Silence betokens consent.
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11130977]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-03-29 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found