From 9c38313d0674d0593dfab87ae83a367e40a7136a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Tue, 24 Sep 2002 18:53:45 +0000 Subject: [PATCH] add thhe Utils.pm module git-svn-id: https://svn.perl.org/qpsmtpd/trunk@79 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/Utils.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/Qpsmtpd/Utils.pm diff --git a/lib/Qpsmtpd/Utils.pm b/lib/Qpsmtpd/Utils.pm new file mode 100644 index 0000000..7ddc801 --- /dev/null +++ b/lib/Qpsmtpd/Utils.pm @@ -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;