qpsmtpd/lib/Qpsmtpd/Utils.pm
Ask Bjørn Hansen 9c38313d06 add thhe Utils.pm module
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@79 958fd67b-6ff1-0310-b445-bb7760255be9
2002-09-24 18:53:45 +00:00

16 lines
232 B
Perl

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;