/usr/lib/gnumeric/1.10.17/plugins/perl-func/perl_func.pl is in gnumeric-plugins-extra 1.10.17-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #!/usr/bin/perl
sub func_perl_adder {
my($a,$b) = @_;
return $a + $b;
}
sub help_perl_adder {
return ($GNM_FUNC_HELP_NAME, "PERL_ADDER:adds two numbers",
$GNM_FUNC_HELP_ARG, "a:number",
$GNM_FUNC_HELP_ARG, "b:number",
$GNM_FUNC_HELP_DESCRIPTION, "Adds two numbers. It is just an example function.",
$GNM_FUNC_HELP_EXAMPLES, "=PERL_ADDER(17,22)");
}
sub desc_perl_adder {
return "ff";
}
sub func_perl_date {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
return sprintf("%04d%02d%02d", $year + 1900, ++$mon, $mday);
}
sub help_perl_date {
return ($GNM_FUNC_HELP_NAME, "PERL_DATE:today's date",
$GNM_FUNC_HELP_DESCRIPTION, "Return today's date as string.",
$GNM_FUNC_HELP_EXAMPLES, "=PERL_DATE()");
}
sub desc_perl_date {
return "";
}
sub func_perl_sed {
my $arg = shift;
my $match = shift;
my $newch = shift;
$arg =~ s/$match/$newch/g;
return $arg;
}
sub help_perl_sed {
return ($GNM_FUNC_HELP_NAME, "PERL_SED:string substitution",
$GNM_FUNC_HELP_ARG, "a:string",
$GNM_FUNC_HELP_ARG, "b:string",
$GNM_FUNC_HELP_ARG, "c:string",
$GNM_FUNC_HELP_DESCRIPTION, <<'EOS',
Substitute string with matching pattern. Same as $@{a} =~ s/$@{b}/$@{c}/g.
EOS
$GNM_FUNC_HELP_EXAMPLES, "=PERL_SED(\"abc\",\"b\",\"d\")");
}
sub desc_perl_sed {
return "sss";
}
|