Conjugate a Latin verb: Difference between revisions
Added Perll
SqrtNegInf (talk | contribs) (Added Perll) |
|||
Line 163:
</pre>
=={{header|Perl}}==
{{trans|Raku}}
<lang perl>use strict;
use warnings;
use feature 'say';
use utf8;
binmode STDOUT, ':utf8';
sub conjugate {
my($verb) = shift;
join "\n", map { $verb . $_ } qw<ō ās at āmus ātis ant>;
}
for my $infinitive ('amāre', 'dare') {
say "\nPresent active indicative conjugation of infinitive $infinitive.";
my($verb) = $infinitive =~ /^ (\w+) [aā] re $/x;
say $verb ? conjugate $verb : "Sorry, don't know how to conjugate $infinitive"
</lang>
{{out}}
<pre>Present active indicative conjugation of infinitive amāre.
amō
amās
amat
amāmus
amātis
amant
Present active indicative conjugation of infinitive dare.
dō
dās
dat
dāmus
dātis
dant</pre>
=={{header|Phix}}==
|