Read about passing array to function in perl, The latest news, videos, and discussion topics about passing array to function in perl from alibabacloud.com
one. DataType (data type ):Perl's data types are roughly four: Scalar (variables), Scalar Array (array), hash array (hash), References (pointer), but they seem to be small but more than sufficient. In particular, you can write a Perl program without
About the origins and characteristics of Perl and Python
Perl is the abbreviation of practical extraction and report Language, created by Larry Wall in 1987, originally designed to facilitate the processing of reports on UNIX, and has become a fully
This is notes from reading the "Object Oriented Perl programming ".
Elements of the @ _ array are special in that they are not copies of the actual arguments of the function call. rather they are aliases for those arguments. that means that if
Chapter 2: References
References are declared as scalar types (named variables starting with $), and reference is obtained using the \ operator.
Modifying the referenced variable is equivalent to modifying the reference pointing to the
1. arrays and hash variables in parameters:
When defining the parameter list, there are two ways to define an array or hash variable as the input parameter:
1. Add the Backslash "/" before the type name of the array or hash variable.
2. Place
Today, I saw an article about passing references in parameters. I mentioned a problem. I have encountered it before, but I used other methods to bypass it.
You can solve this problem by passing parameter references. So I plan to write it down. Hope
We often use a program in Linux to add parameters. Now let's take a look at the functions related to control parameters in Perl. getopt. in Linux, there are two types of parameters. one is -- help, and the other is-H. that is, the difference between-
We often use a program in Linux to add parameters, and now it is much more powerful to understand the module Getopt::long in Perl about control parameters than to use @ARGV arrays directly. I think you know there are two different types of
Basic usage
#初始化%h is an empty array%h={};#用数组初始化%h for A=>1,b=>2%h= (' A ', 1, ' B ', 2);#意义同上 is just another, more figurative way of writing. %h= (' A ' =>1, ' B ' =>2);#如果key是字符串, you can omit the quotation marks. The following line is the same
I. subaccountProgramReferences:
In Perl, you can not only create references to scalar variables, array variables, and hash variables, but also create references to subprograms. References to subprograms are similar to function pointers in C/C ++;
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.