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
I. Data Types(Data type):
Perl has four data types: Scalar (variable), Scalar Array (Array), Hash Array (Hash), and References (pointer ), it seems to be rare, but it is more than enough to use it. Especially when writing Perl programs, you do not
GrammarThere are only two ways to create ' references ', and they are two.
Creating references
Create Rule 1If you add a '/' number in front of a variable, you get a ' reference ' to the variable.
$aref =/@array; # $aref Keep a ' reference ' to
Syntax
There are only two ways to create a 'quot.
Create reference
Create Rule 1If you add a '/' sign before a variable, you will get the 'quota' of the variable '.
$ Aref = // @ array; # $ Aref saves the 'quot' pointing to @ Array'$ Href =/% hash;
A) Sort function usage
Sort LISTSort Block LISTSort SubName LIST
The use of sort is in the form of 3 different forms. It sorts the list and returns the sorted lists. If SubName or Block,sort are omitted in the standard string comparison order (for
A) Sort function usageSort LISTSort BLOCK LISTSort SubName LISTThe use of sort is in the form of 3. It sorts the list and returns the sorted lists. If the subname or Block,sort are ignored in the order of standard string comparisons (for example,
Introduction to Perl basic array sorting methods
This article describes how to use Perl to sort strings or numeric arrays.
Perl has a built-in function called sort which can undoubtedly sort an array. The simplest form is to pass an array, which
This article mainly introduces Perl famous Schwartzian conversion problem solving implementation, this article explained the Schwartzian transformation involves the sorting question, and also gives the realization code, needs the friend to be
This article mainly introduces how to solve the famous Schwartzian conversion problem in Perl. This article describes the ordering problem involved in the Schwartzian conversion and provides the implementation code, if you need a conversion, refer
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.