add thhe Utils.pm module
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@79 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
806fcf25e8
commit
9c38313d06
15
lib/Qpsmtpd/Utils.pm
Normal file
15
lib/Qpsmtpd/Utils.pm
Normal file
@ -0,0 +1,15 @@
|
||||
package Qpsmtpd::Utils;
|
||||
use strict;
|
||||
|
||||
sub tildeexp {
|
||||
my $path = shift;
|
||||
$path =~ s{^~([^/]*)} {
|
||||
$1
|
||||
? (getpwnam($1))[7]
|
||||
: ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7])
|
||||
}ex;
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
||||
1;
|
Loading…
Reference in New Issue
Block a user