HTMLGoodies
The ultimate html resource
Earthweb.com


About the Double-Underlined Links


Become a Partner




Search Clipart.com:



internet.commerce















HTML Goodies : Primers : Perl Primer: HTML Goodies: PERL Primer, Part 1

HTML GOODIES TO GO NEWSLETTER


Other Related Newsletters

HTML Goodies: PERL Primer, Part 1


By Joe Burns

...use these to jump around or read it all

[What You Need] [Why A Path?]
[What Is PERL?]

     If you were going to undertake learning HTML or JavaScript, you're probably pretty much ready to go with the equipment you have right now. A browser and some kind of text editor are all you need to get started.

     PERL is a little different. You need to have access to a server that has granted you permission to use PERL. Some will tell you, as I have been told many times, you can get your own copy of PERL at http://www.perl.com/ (under Downloads) and install it on your own computer. I've never done that so I wouldn't ask that you do it. I am going to teach you using the same methods I used to learn the language. I tested all of my files online, so that's the way I'll suggest you do it. If you want to install PERL on your system, more power to you. If it's successful, let me know.

     I write and edit my PERL scripts in the same text editor I use to write my HTML: Notepad. I suggest you also use Notepad. You may use an assistant program to edit your HTML document. If so, you DO NOT want to edit your PERL scripts in that assistant. HTML assistant programs are known for adding code and altering your work without telling you. These PERL scripts must be saved as text only, with nothing more than what you wrote to the page. Notepad is the way to go.

     Now that you have the tools on your end, let's talk about the server end.


What You Need

  •      You will need an account with an Internet Service Provider (ISP) that will allow you access to PERL. I have only ever worked with UNIX servers when dealing with PERL, so these primers will also follow that format. Yes, PERL is available on NT servers now, but the methods of using it there are different than what I will discuss here. If I were to make a strong suggestion, I would suggest finding a UNIX server.

         NT servers will most likely be running something called Active PERL. The program adds the PERL path to the system path. Again, you'll need to check with your system administrator to get a handle on all of the specifics. I've never used PERL on any system other than UNIX. I can't imagine that PERL on NT is overly hard, but you'll need to get the scoop on that from your server people rather than me.

  •      The server should allow you the ability to change file and directory (CGI-BIN) permission. This will explained in Primer Two. How you set your permissions is up to you. I set all of mine by Telnetting into the server and doing it by hand. You may want to use an FTP program. Ask your ISP the best way to set your permissions on their system. I will discuss settings modification here through Telnet. If your ISP wants you to set permissions through an FTP program, let me know and I'll post a link to it here.

         I have been on three different servers that would not allow me to create a CGI-BIN for my PERL scripts. They had to create it for me. Past that, I was allowed to post scripts into that directory. If that's the case, be happy. They saved you a step.

  •      PERL is not big on popping up error messages when the script fails to run, so you need to ask your ISP to allow you access to their PERL error log. This will make your life a great deal easier when the script won't run. The only problem I've run into, in terms of error logs, is that you get to see everyone else's errors. The last three servers I've used showed all errors, listing them as they came in. You may have to sort through the list if the server is busy and people have a lot of bad scripts running. I'm on that server right now!

  •      You need to find out your server's path to PERL. The traditional path is:

    /usr/bin/perl

         In fact, that's the path I'll use when you get the scripts in these primers. Every server I've been on has followed this path. Your ISP may be different. The easiest way to find your server's path is to Telnet into your account and, at the prompt, type in:

    whereis perl

         The path will be returned. Yes, I know it's easier to simply ask the person selling you the ISP account, but he or she is busy. You can find that path yourself. ;-)

     Once you have all of the above, which you may already have, we can get started.


Why A Path?

     You need to know the path to PERL because the scripts that you create needs to know it. PERL is the program that sits on the server. The pages you'll write are PERL scripts. You see, it's not your script that does the work, it's PERL. Your script is simply a bridge between the HTML and the PERL on the server. Think of your script as the instructions, but it's PERL that actually does the work.

     Without that path, the script doesn't know where PERL is located. It can't complete the functions you're asking it to complete. That path connects your script to the engine that drives it. That's why you need a path.


What Is PERL?

     Practical Extraction and Report Language. You sharp-eyed readers may now be wondering why it's spelled "PERL" rather than "PEARL". It's because when the language came out, there already was a "PEARL". (You knew it was going to be a scary scientific answer, didn't you?)

     PERL was almost named "GLORIA", after the wife of the man who invented it, Larry Wall. Wall was given the task of creating a program that would allow interaction and control between computers on both U.S. coasts. He started with a program he had written earlier, rm, and bulked it up to perform all the functions he needed to control 12 computers. PERL was the result.

     And now you're going to start learning it yourself. Primer Two will get you into your server, create a CGI-BIN, and start you on your way to setting file permissions. After the next primer, you'll actually know what I mean when I tell you to chmod to 775.

     Won't that impress your friends?

On to Primer Two...



[What You Need] [Why A Path?]
[What Is PERL?]

Tools:
Add htmlgoodies.com to your favorites
Add htmlgoodies.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

IT Management Networking & Communications Web Development Hardware & Systems Software Development Earthwebnews.com



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES