Made owl_util_makepath available from perl
There's probably a better way to do this. Maybe
sub makepath {
my $filename = shift;
$filename =~ s{ ^ ~ ( [^/]* ) } { $1 ? (getpwnam($1))[7]
: ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7] ) }ex;
return $filename;
}
(http://docstore.mik.ua/orelly/perl/cookbook/ch07_04.htm) or something.
Additionally, I'm not sure why
PREINIT:
char *rv = NULL;
CODE:
{
rv = foo();
RETVAL = rv;
}
OUTPUT:
RETVAL
CLEANUP:
g_free(rv);
is the paradigm for functions returning strings, when foo returns `char
*` and not `const char *`. I've removed the `= NULL` part of the
initlization, which I assume is left over from when we had to NULL-check
things before freeing them, but I've copied the rest of the code.