About us Privacy Disclaimer Contact us
FAQ Help Advertising Feedback
Home Sitemap Search Donate us

  Home > Computer & I'net > Print...

   Browse by title articles:
   What is hot:

Escape Code

Script Linking

Search & Replace

Print

Arrays

Common Operators

Keep your navigation simple!
Bad Web Design: Looong Pages
PHP File Attachments
Which Domain Name for me?
Prev articles1 2 3456Next articles



Print


Computer & I'net articlesPrint

by David Stanley    



The PRINT command in Perl is probably the most known and used. It is used to display things to the monitor screen.

I will start with the famous "Hello World!". Why is this the starting page for everyone to create? Oh well, who am I to mess with a good thing? LMAO! If you are unfamiliar with this concept... this is an extremely simple page/script that will print the words "Hello world!" on the screen.

Print is a built in Perl function. It sends output to a specific location. The location is "STandarD OUTput" also known as STDOUT. For the rest of us common folks, that means "the monitor screen". The print command is specific to the monitor screen, so stating an actual <STDOUT> command is unnecessary.

Ready for the code?

#!/usr/bin/perl
print "Content-type: text/html ";
print ("Hello World!");

The first line (shebang) tells the coding where to find the Perl translator. You should have read about this back on the BASICS page. The second line tells the browser that this PERL is working on the Internet. The last line states to print the following message. By default, it assumes STDOUT so the message will appear on the monitor screen.

The PRINT command is actually a very powerful one. It can be used to display parts of a web page using HTML coding, or even an entire web page! That circumstance is probably a bit out of the ordinary, but the possibilities are there.

#!/usr/bin/perl
print "Content-type: text/html ";
print "<html><head><title>Test</title></head><body> ";
print "<h1>Hello world!</h1> ";
print "</body></html>";

You will find the PRINT command rather handy as the tutorials go further.




-----------------

Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission.






Articles

Auto & Trucks

Business

Computer & I'net

  ·General

  ·Apache

  ·CSS

  ·Database

  ·Hardware

  ·HTML

  ·Javascript&DHTML

  ·Linux

  ·MySQL

  ·Operating System

Perl / CGI

  ·PHP

  ·Programming

  ·Publishing

  ·Search Engines

  ·Software Problems

  ·SSI

  ·Tips & Tricks

  ·Utilities

  ·Web Design

Family

Food & Drink

Gardening

Health

Other

Pets

Psychology

Spiritual

Travel

Women

 Calculators

Cost Spreading




  Disclaimer | Privacy | Terms of useCopyright © 2004 Nice2know.com