C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...









What is PERL


Posted Date: 09 May 2008    Resource Type: Tools and Utilities    Category: Miscellanous

Posted By: Mahesh Raj       Member Level: Gold
Rating:     Points: 5



Perl is used to create the equivalent of DOS batch files or C shell scripts.It is used for a variety of tasks like Web development and most commnly it is used to develop CGI scripts. One of the nice things about Perl is that, because it is a scripting language, people give away source code for their programs. This gives you the opportunity to learn Perl by example, and you can also download and modify thousands of Perl scripts for your own use. One of the bad things about Perl is that much of this free code is impossible to understand.
You create a subroutine with the word sub.

All variables passed to the subroutine arrive in an array called _. Therefore, the following code works

show ('cat', 'dog', 'eel');

sub show
{
for ($i = 0; $i <= $#_; $i++)
{
print $_[$i], "\n";
}
}

Remember that $# returns the highest index in the array (the number of elements minus 1), so $#_ is the number of parameters minus 1. If you like that sort of obtuseness, then you will love PERL.

You can declare local variables in a subroutine with the word local, as in:

sub xxx
{
local ($a, $b, $c)
...
}

You can also call a function using &, as in:

&show ('a', 'b', 'c');

The & symbol is required only when there is ambiguity, but some programmers use it all the time.

To return a value from a subroutine, use the keyword return.




Responses

Author: Redhat    12 Jun 2008Member Level: Silver   Points : 1
This is very good information,Continue posting such useful articles.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: WEB2.0 was a result of brainstorming session
Previous Resource: HTML tool for Transforming,Validating XML using Javascipt
Return to Discussion Resource Index
Post New Resource
Category: Miscellanous


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use