[Ilugc] [TIP] perl tutorial XI (some perl functions)

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Tue, 13 Dec 2011 05:48:30 +0530

$perldoc -f length

will tell you the way the length() function call works.

If it works on a scalar string it will tell you the number of
characters and if it works on
 an array it will tell you the number of elements.

You don't need me to find out what a perl function would do.

First pick up a book or some good site on perl and memorize all the
important functions.

There are only around 25 important functions. Try to reinforce the
perl way of coding
 into your brain.

Try out examples and build real life perl code around the use of each function.

I can tell you some trivial computer science nonsense like you can
have a queue and a stack
 using perl arrays with the functions to add and remove elems, ents
from the top of the stack and front of the queue.

push(), pop(), shift() and unshift().

Normally the perl idiom is to use push() to populate an array.

You don't have linked lists in perl. You do have pointers in the form
of references and
 you can combine arrays, hashes and have array of arrays.

For that you have to have a firm grasp of perl pointers.

Once you learn it is fun.

It won't be as hard as regex.

To construct and use an array of arrays or a hash of hashes is bit time taking.

Look at these man pages.

$ perldoc perllol

$perldoc perldsc

Don't feel scared.

Every hard problem in life is tackled with confidence, boldness,
manliness and a little
 bit of patience.

Patience wins in the end. Keep at it.

We will explore these topics in turn one by one.

-Girish

-- 
G3 Tech
Networking appliance company
web: http://g3tech.in ?mail: girish at g3tech.in

Other related posts:

  • » [Ilugc] [TIP] perl tutorial XI (some perl functions) - Girish Venkatachalam