Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Code Newbie > Submit Tutorials > Perl
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 02-24-2003, 01:36 PM   #1 (permalink)
tin_man
Registered User
 
tin_man's Avatar
 
Join Date: May 2002
Posts: 4
tin_man is on a distinguished road
Send a message via AIM to tin_man Send a message via Yahoo to tin_man
Hello World in perl

Everyone needs a place to start, and the Hello World program is as good a place as any. This is a really simple script, just displays the string "Hello World".

Code:
#!/usr/bin/eval perl -w print "Hello World";
that's it :-D
Let's look at that line by line though

Code:
#!/usr/bin/eval perl -w
this line is the shebang line, it tells the OS what to use to intrepert the file with, I prefer to use /usr/bin/eval perl as opposed to just /usr/bin/perl because it gives your script more portability. The -w switch tells the perl intrepter to spit out warning, very useful for debuging.

Code:
print "Hello World";
This is pretty self-explainatory, it prints "Hello World", notice though that in perl as in C/C++, lines end in a semi-colon.
__________________
tin_man is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
{perl} HTTP Error Code Response gty All Other Coding Languages 2 09-08-2004 11:09 AM
how come i dont hear much about perl Apodysophilia All Other Coding Languages 2 12-16-2003 10:05 AM
Is Perl obsolete or something? Epsilon Perl 13 06-15-2003 12:14 AM
Diffrent storage types in perl tin_man Perl 0 02-24-2003 01:55 PM
Hello World anon Javascript 0 02-24-2003 01:41 PM


All times are GMT -8. The time now is 02:05 AM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle