Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Not long ago I was lucky enough to hear TheDamian's Perligata talk. I suppose you could say it inspired me (one could also say that I have more time than sense) and I decided to try my hand at writing something simple. Those five years of Latin in school have to be good for something, right? Surely I could write one of the exercises from Learning Perl in Latin.

A couple of hours later I had this:

#!/usr/bin/perl -w use Lingua::Romana::Perligata; Enter tum radius inquementum tum biguttam tum lacunam egresso scribe. meo radiuso vestibulo perlegementum da. meo multipliero multiplicamentum II tum MMMCXLI Mimum da. meo circumferenceo multiplicamentum multiplierum tum radiusum da. scribe egresso dictum sic Circumference cis. biguttam tum lacunam tum circumferenceum tum novumversum egresso scribe.

Here's a closer look.

Enter tum radius inquementum tum biguttam tum lacunam egresso scribe.
Write to the exit (STDOUT) "Enter" then "radius" then a colon and then a space.

meo radiuso vestibulo perlegementum da.
Give to my $radius the data from the entrance (STDIN).

meo multipliero multiplicamentum II tum MMMCXLI Mimum da.
Give to my $multiplier the product of 2 and 3.141. (Yes, this is inelegant along with the next line - ideally I'd be doing all the multiplication in one go, but I kept running into glitches.)

meo circumferenceo multiplicamentum multiplierum tum radiusum da.
Give to my $circumference the product of $multiplier and $radius.

scribe egresso dictum sic Circumference cis. biguttam tum lacunam tum cirfumferenceum tum novumversum egresso scribe.
Write to the exit "Circumference" then write also a colon, a space, $circumference, and a newline. (Again, inelegant - I have two print statements to produce one line, but I was running into trouble with all the tums.)

If you use Lingua::Romana::Perligata 'converte' you can see what the translated-back-to-Perl is.

print (STDOUT Lingua::Romana::Perligata::__enquote__ ( 'Enter', 'radiu +s'), ":", " "); my $radius = IO::Handle::getline (*STDIN ); my $multiplier = (2 * 3.141); my $circumference = ($multiplier * $radius); print (STDOUT 'Circumference'); print (STDOUT ":", " ", $circumference, "\n")

This is really helpful when writing Perligata.

Did I learn something from this? You bet. Even though my Latin is extremely rusty, thinking about Perl in terms of a spoken (albeit dead) language gave me a new outlook. Plus it looks cool. I also found that the best way to approach writing in Perligata is not to take regular Perl and try to translate it one line at a time, but to actually think in Perligata. (Your milage may vary, of course.)


In reply to Learning Perligata by ailie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-26 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found