| 1 | package WWW::Noss::Home; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use 5.016; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | our $VERSION = '2.05'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | our @EXPORT_OK = qw(home); | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | my $HOME = $^O eq 'Win32' ? $ENV{ USERPROFILE } : (<~>)[0]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | undef $HOME if defined $HOME and ! -d $HOME; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $HOME and not -d $HOME
MC/DC0%0/2
defined $HOME and not -d $HOME
defined $HOME
not -d $HOME
Truth table33%1/3
A and not(B)
A= defined $HOMEB= not -d $HOME
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 3 | ▶ | sub home { $HOME // die "Could not determine home directory\n" } | ||||||||||||||||||||||||||
|
Subroutine
home: called CC=2 SCAR=7.6
Pod
documented
Condition50%1/2
$HOME // die("Could not determine home directory\n")
MC/DC0%0/1
$HOME // die("Could not determine home directory\n")
$HOME
Truth table50%1/2
A
A= $HOME
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 2 | 1; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | =head1 NAME | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | WWW::Noss::Home - Find user's home directory | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | =head1 USAGE | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | use WWW::Noss::Home qw(home); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | my $home = home; | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | B<WWW::Noss::Home> is a module that provides the C<home()> subroutine for | ||||||||||||||||||||||||||||
| 30 | locating the running user's home directory. This is a private module, please | ||||||||||||||||||||||||||||
| 31 | consult the L<noss> manual for user documentation. | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | =head1 SUBROUTINES | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | Subroutines are not exported automatically. | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | =over 4 | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =item $home = home() | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | Returns the path to the running user's home directory. Dies on failure. | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | =back | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | Written by Samuel Young, E<lt>samyoung@posteo.comE<gt>. | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | This project's source can be found on its | ||||||||||||||||||||||||||||
| 50 | L<Codeberg page|https://codeberg.org/1-1sam/noss.git>. Comments and pull | ||||||||||||||||||||||||||||
| 51 | requests are welcome! | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | Copyright (C) 2025-2026 Samuel Young | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | This program is free software: you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 58 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||
| 59 | the Free Software Foundation, either version 3 of the License, or | ||||||||||||||||||||||||||||
| 60 | (at your option) any later version. | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | L<noss> | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | =cut | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | # vim: expandtab shiftwidth=4 | ||||||||||||||||||||||||||||