| Subcribe via RSS

Use operator $# in Perl

August 13th, 2008 | No Comments | Posted in Perl

In the last few weeks I have been developing a lot of scripts in Perl, I’m not a fan of this scripting language but is very useful in some cases, but I had some troubles with arrays and list in Perl , and today I saw a mistake in my code, and that was how I was using the operator $#.

The $# operator will get the index value of last element in a specific array, and It will not return the length of the array this was my mistake , that’s what happend when you don’t read the documentation :-s.

A simple example how to use this operator. More »

Tags: