Peter Nixon <listuser(at)peternixon(dot)net> writes:
> radius=# create function testperltest3 (text) returns text as '
> radius'# my $datetime = $_[0];
> radius'# # Remove . from the start of time fields (routers that have
> lost ntp timesync)
> radius'# $datetime =~ s/^\.*//;
> radius'# return $datetime;
> radius'# ' language 'plperl';
> CREATE FUNCTION
You need another backslash --- the string-literal parser is eating that
one, so Perl sees s/^.*//.
regards, tom lane