Perl Arraysa Perl array is a list variable that stores scalar values, and variables can be of different types. array variables begin with @. Access array elements are read using the $ + variable name + [index value] format. 1. Creating an array1.
There are four common functions for array manipulation in Perl:Push: Adds an element from the end of the array.Pop: Extracting elements from the end of an arrayShift: Extracting elements from the beginning of an arrayUnshift: Adding elements from
The previous article lists the similarities and differences between the ways of objects and JS in Perl. This continues to complement the array, the hash of the associated operation.
One, array
You can add additions and deletions to the array.
Process processing functions
1. Process Start functionFunction name EvalCall Syntax eval (string)The commentary considers a string as a Perl statement execution.When executed correctly, the system variable $@ is an empty string, and if there is an
The array element in Perl starts with a reference ordinal of 0, the first element of the @array is $array[0], increments sequentially, and the last element is $array[-1] or $ #array. If you want to delete an existing element in an array, you can do
Most statement expressions in the Perl language are followed by a semicolon, separating the different Perl statements.The Perl interpreter can compile and run these two actions at a time. Perl uses a pair of anti-quotes "'" to indicate running
All numbers have the same format internally in prel. In fact the Perl use double-precision floating-point value to store numbers.
Creating charaters by code point: CHR (), and ord () metheds.
E.g.
$alef = chr(0x05df) ;$code_point = ord('d') ;
In
Perl Common function set 2
I. Process processing functions1. Process startup FunctionFunction Name evalCall the syntax eval_r (string)The description regards string as a Perl statement execution.After the command is correctly executed, the
How to delete a value from an array in Perl
This article mainly introduces how to delete a value from an array in Perl? This article explains how to assign an array element to undef and then delete the element from the array. For more information,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.