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:
Ask Bjørn Hansen 2002-09-24 18:53:45 +00:00
parent 806fcf25e8
commit 9c38313d06

15
lib/Qpsmtpd/Utils.pm Normal file
View 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;