Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

Perl

TIPS....This week

 

 To extract elements from an array use grep : @smallrarray = grep ( (($_ >= $mycounter) && ($_ <= $myouterlimit)), @largearray);                                  

To replace(delete) all occurences of a blank space in a variable use :  $variable =~ s/ //g;      

PERL Arrays

The highest index of an @array is given by $#array                                        To add an new element to the array use @array[($#array)+1] = $newvalue;

Perl Array Functions - must look ats http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfunc/

Look at splice , pop, push and shift  eg Splice removes an element anywhere in an array -e.g the following removes  $offset elements from the array @lines at position $line_entry

 splice(@lines,$line_entry,$offset);

          print " $#lines entries in the lines array\n";