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.
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
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,
I. Process processing functions
1. Process startup Function
Function Name eval
Call the syntax eval (string)
Describe the stringPerlStatement execution.
After the command is correctly executed, the system variable $ @ is an empty string. If an error
This article focuses on how to remove a value from an array in Perl? This article explains how to assign the elements of an array to undef, and then delete the elements from the array, and the friends you need can refer to the
I'm not sure if undef
Introduction to the Perl language instructions for a scalar scalar constant numeric string number and string conversion scalar variable Print output result comparison operator get user input undef value scalar context two list array list arrays note
Summarize some of the uses of list and array operations in Perl
Suppose you define an array variable @arr and assign the list (str_a, Str_b, Str_c, str_d) to the array @arr
@arr = (str_a, Str_b, Str_c, str_d);
Assign the number of elements in an
1. Using the grep functionFunction name grep
Call Syntax @foundlist = grep (pattern, @searchlist);
Explanation similar to the UNIX lookup tool with the same name, the grep function extracts the element in the list that matches the specified pattern,
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.