PERLANCAR::File::HomeDir - Lightweight way to get current user's home directory
This document describes version 0.060 of PERLANCAR::File::HomeDir (from Perl distribution PERLANCAR-File-HomeDir), released on 2018-09-20.
use PERLANCAR::File::HomeDir qw(get_my_home_dir get_user_home_dir); my $dir = get_my_home_dir(); # e.g. "/home/ujang" $dir = get_user_home_dir("ujang");
This is a (temporary?) module to get user's home directory. It is a lightweight version of File::HomeDir with fewer OS support (only Windows and Unix) and fewer logic/heuristic.
If set to true, will die on failure. Else, function usually return undef on failure.
None are exported by default, but they are exportable.
Usage:
my $home_dir = get_my_home_dir();
Try several ways to get home directory of the current user. Return undef or die (depends on $DIE_ON_FAILURE) if everything fails.
$DIE_ON_FAILURE
my $home_dir = get_user_home_dir($username);
Try several ways to get home directory of a specified user ($username).
$username
Please visit the project's homepage at https://metacpan.org/release/PERLANCAR-File-HomeDir.
Source repository is at https://github.com/perlancar/perl-PERLANCAR-File-HomeDir.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=PERLANCAR-File-HomeDir
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
File::HomeDir
perlancar <perlancar@cpan.org>
This software is copyright (c) 2018, 2017, 2016, 2015 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install PERLANCAR::File::HomeDir, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PERLANCAR::File::HomeDir
CPAN shell
perl -MCPAN -e shell install PERLANCAR::File::HomeDir
For more information on module installation, please visit the detailed CPAN module installation guide.