Calculating Primes – Part 1

Today I am going to talk about calculating primes. Not the Transformer movie in which Optimus Prime has to help the humans save the world. I am talking about prime numbers in which the number is only divisable by one and itself. The Algorithm that I am going to introduce is a brute force method for calculating prime numbers. It is great for comparing the computing power of two machines by looking at overall execution times. This routine consists in dividing n by each integer m which is greater than…

Excel Files

Business Users like to have data in a spreadsheet format. Since Microsoft Office is installed world-wide, it will be a common request for data in a XLS format. Let’s make believe that we have the business problem to write and read information about the first five presidents to a MS Excel file. The Cliché, there are many ways to skin a cat, does apply to technical solutions. I installed the write package (Spreadsheet::WriteExcel) and read package (Spreadsheet::ParseExcel) from CPAN to solve my problem. Both packages have more methods and properties…

Application Logging

Error handling and application logging are the most import tasks associated with programming that are over looked by many developers. After a program is released to the field, how do you know if it is performing as it should? Are there issues with the language execution (1-tier), with the database (2-tier) or with the middle-ware (3-tier) ? Many times, issues are only noticed and acted upon after several complaints have been issued. Here is a short list of why you should adding logging to all programs that you create. Traps…

Running the SMTP Relay

Today, I want to talk about sending email using SMTP relay host. The topic of a SMTP relay is an mportant one that you will come across in your career. A open mail relay allows a PERL script to send mail messages from a mail box that you can name and does not have to exist on the mail server. In todays information world, it is very important to stay connected via emails. Emails can be used for many different purposes in your PERL scripts. Alerting when system thresholds or…

Text Files

The first type of file that every programmer writes to and reads from is an ASCII text file. A text file is a kind of computer file that is structured as a sequence of lines. Each line is terminated with a special character such as a line feed (LF) in UNIX or a carriage return (CR) and line feed (LF) in MS DOS. One special type of text file is called a Comma Seperated Value (CSV) file. CSV is a delimited data format that has fields/columns separated by the comma…