Friday, March 20, 2020

Testing Your Perl Installation

Testing Your Perl Installation In order to test our fresh installation of Perl, well need a simple Perl program. The first thing most new programmers learn is how to make the script say Hello World. Lets look at a simple Perl script that does just that. #!/usr/bin/perl print Hello World.\n; The first line is there to tell the computer where the Perl interpreter is located. Perl is an interpreted language, which means that rather than compiling our programs, we use the Perl interpreter to run them. This first line is usually #!/usr/bin/perl or #!/usr/local/bin/perl, but depends on how Perl was installed on your system. The second line tells the Perl interpreter to print the words Hello World. followed by a newline (a carriage return). If our Perl installation is working correctly, then when we run the program, we should see the following output: Hello World. Testing your Perl installation is different depending on the type of system you are using, but well take a look at the two most common situations: Testing Perl on Windows  (ActivePerl)Testing Perl on *nix Systems The first thing youll want to do is make sure youve followed the  ActivePerl Installation tutorial  and installed ActivePerl and the Perl Package Manager on your machine. Next, create a folder on your C: drive to store your scripts in for the sake of the tutorial, well call this folder  perlscripts. Copy the Hello World program into C:\perlscripts\ and make sure the filename is  hello.pl. Getting a Windows Command Prompt Now we need to get to a Windows command prompt. Do this by clicking on the  Start  menu and selecting the item  Run.... This will pop up the run screen that contains the  Open:  line. From here, just type  cmd  into the  Open:  field and press the  Enter  key. This will open (yet another) window which is our Windows command prompt. You should see something like this: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\perlguide\Desktop We need to change to the directory (cd) that contains our Perl scripts by typing in the following command: cd c:\perlscripts That should make our prompt reflect the change in the path like so: C:\perlscripts Now that were in the same directory as the script, we can run it simply by typing its name at the command prompt: hello.pl If Perl is installed and running correctly, it should output the phrase Hello World., and then return you to the Windows command prompt. An alternate method of testing your Perl installation is by running the interpreter itself with the  -v  flag: perl -v If the Perl interpreter is working correctly, this should output quite a bit of information, including the current version of Perl you are running. Testing Your Installation If you are using a school or work Unix / Linux server, chances are Perl is already installed and running when in doubt, just ask your system administrator or technical staff. There are a few ways we can test our installation, but first, you will need to complete two preliminary steps.​ First, you must copy your Hello World program to your home directory. This is usually accomplished via FTP.   Once your script has been copied to your server, you will need to get to a  shell prompt  on the machine, usually via SSH. When you have reached the command prompt, you can change into your  home  directory by typing the following command: cd ~ Once there, testing your Perl installation is very similar to testing on a windows system with one extra step. In order to  execute  the program, you must first tell the operating system that the file is OK to execute. This is done by setting the permissions on the script so that anyone can execute it. You can do this by using the  chmod  command: chmod 755 hello.pl Once youve set the permissions, you can then execute the script by simply typing its name. hello.pl If that doesnt work, you might not have your home directory in your current path. As long as you are in the same directory as the script, you can tell the operating system to run the program (in the current directory) like so: ./hello.pl If Perl is installed and running correctly, it should output the phrase Hello World., and then return you to the Windows command prompt. An alternate method of testing your Perl installation is by running the interpreter itself with the  -v  flag: perl -v If the Perl interpreter is working correctly, this should output quite a bit of information, including the current version of Perl you are running.

Tuesday, March 3, 2020

Indulgences and their Role in the Reformation

Indulgences and their Role in the Reformation An ‘indulgence’ was part of medieval Catholicism and a major trigger to the Protestant Reformation. Basically, indulgences could be purchased in order to reduce the punishment you were owed for your sins. Buy an indulgence for a loved one, and they would go to heaven and not burn in hell. Buy an indulgence for yourself, and you neednt worry about that pesky affair youd been having. If this sounds like cash or good deeds for less pain, that is exactly what it was. To many holy people like Martin Luther, this was against Jesus, against the idea of the church, against the point of seeking forgiveness and redemption. When Luther acted against it, Europe had evolved to the point that it would split in the revolution of the Reformation. What They Did The medieval western Christian church – the Eastern Orthodox church was different and not covered by this article – included two key concepts which allowed indulgences to occur. Firstly, you were going to be punished for the sins you accumulated in life, and this punishment was only partly erased by good works (like pilgrimage, prayers or donations to charity), divine forgiveness and absolution. The more you had sinned, the greater the punishment. Secondly, by the medieval era, the concept of purgatory had developed: a state entered after death where you would suffer the punishment which would reduce your sins until you were free, so you weren’t damned to hell but could work things off. This system invited something which would enable sinners to reduce their punishments in return for something else, and as purgatory emerged so bishops were given the powers to reduce penance. This developed in the crusades, where you were encouraged to go and fight (often) abroad in return for your sins being canceled. It proved a highly useful tool to motivate a worldview where the church, God,  and sin were central.From this, the indulgence system developed. Do enough to earn a full or ‘Plenary’ indulgence from the Pope or lesser ranks of churchmen, and all your sin (and punishment) was erased. Partial indulgences would cover a lesser amount, and complex systems developed which claimed to tell you to the day how much sin you’d canceled. Why They Went Wrong This system of reducing sin and punishment then went, to the eyes of many Reformation reformers, hideously wrong. People who didn’t, or couldn’t, go on crusade wondered whether some other practice might allow them to earn the indulgence. Perhaps something financial? So the indulgence came to be associated with people ‘buying’ them, whether by offering to donate sums to charitable works, to buildings to praise the church and all the other ways money could be used. This began in the thirteenth century and developed, to the point where government and church were creaming off a percentage of the funds, and complaints about selling forgiveness spread. You could even buy indulgences for your ancestors, relatives, and friends who were already dead. The Division of Christianity Money had infested the indulgence system, and when Martin Luther wrote his 95 Theses in 1517 he attacked it. As the church attacked him back he developed his views, and indulgences were squarely in his sights. Why, he wondered, did the church need to accumulate money when the Pope could, really, just free everyone from purgatory by himself? The church divided into fragments, many of which threw the indulgence system entirely out, and while they didn’t cancel the underpinnings, the Papacy reacted by banning the sale of indulgences in 1567 (but they still existed within the system.) Indulgences were the trigger to centuries of bottled up anger and confusion against the church and allowed it to be cleaved into pieces.