qpsmtpd/lib/Qpsmtpd/Utils.pm
2013-08-05 15:05:15 -07:00

15 lines
231 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;