In this article we learned how to sort strings or arrays of numbers in Perl.
Perl has a built-in function called sort. There is no doubt that you can sort an array. The simplest form is to pass an array that returns an array of sorted elements.
Copy Code code as follows:
#!/bin/perl
Use strict;
Use warnings;
#定义变量
My $count;
My $input;
My $number;
My $sentence;
My $story;
#定义四个数组
#定义了人物数组
My @nouns =
(
' Dad ',
' TV ',
' Mom ',
' Groucho ',
' Rebecca ',
' Harpo ',
An introduction to regular expressions in Perl
First, Introduction
Two, matching operator
Iii. special characters in the pattern
1, character +
2, characters [] and [^]
3, character * and?
4, escape character
5. Match any letter or number
6, Anchor
Perl use vs. require usage
Contrast (i) Description:Both of these functions are a means of loading and referencing Perl's modules, or subroutines,
The difference is that Perl use is found in the current default, and once the module is not in the
first, open, close the file
The return value of open is used to determine whether the operation that opened the file succeeds, returns a value other than 0 when it succeeds, and returns zero when it fails, so it can be judged as follows:if (Open
The Spreadsheet::WriteExcel and spreadsheet are available on Linux or UNIX (generated) Excel,cpan::P arseexcel these two modules.
Here's a look at Spreadsheet::WriteExcel and spreadsheet: How to use the:P arseexcel.
First, install the appropriate
ajax|perl| Questions | Chinese
Ajax, the latest very booming technology. There are a lot of ready-made development kits. At the beginning I tried the cpaint and supported php/asp. Not bad. It was later started with Perl Ajax: Cgi::ajax. By contrast,
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
First, Perl installation:1. Download and unzip the software: Tar zxvf perl-5.24.0.tar.gz2, run./configure.gnu-help view Help, run./configure.gnu-des-dprefix=/usr/local/perl-dusethreads-uversiononly Set source code3. Compiling and installing
This article will present the most commonly used four dynamic Web Language Perl (Practical Extraction and report Language), PHP (hypertext Preprocessor), ASP (Active Server pages) , JSP (JavaServer Pages) for some technical comparisons.PerlPerl
The method of encrypting signature in Ucloud API document is not clear, and there is no Perl version, specially wrote a copy for everyone to refer UseUri::Escape; UseUTF8; UseEncode; UseANYEVENT::HTTP::LWP::useragent; UseDigest::SHA QW (SHA1
When the Perl script begins to execute, it opens by default3File handle: Stdout,stdin,stderrstdout (Standard OUTPU) is the default output file handle. The data sent to this file handle is displayed on the user-specified output device, typically a
First, let's take a look at the two main functions of POSIX-style Regular Expressions:
Ereg function: (Regular Expression matching)
Format: int ereg (string pattern, string [, array & regs])Note: The preg_match () function using Perl
The project needs to send soap messages for some operations. Because the SOAP protocol is built on the HTTP protocol, this problem can also be solved by sending HTTP requests. In addition, the project also needs to consider support for the SSL
I. Special variables of Regular Expressions:1. $ N: contains the nth substring of the last pattern match.2. $ &: String matched in the previous successful mode3. $ ': Content Before the successful substring4. $ ': content after the child string that
Usage of our in perlRequire 5.006If the version number is less than 5.006, a failure is returned, causing the module to fail to be loaded.Therefore, it is used to ensure the Perl version of the module call environment.
Like my, our declares
Open a file using the Open () function
Common methods to open a file are:
Copy codeThe Code is as follows: open (FH, "Or die "Couldn't open $ filename for reading: $! ";
The open () function usually has two parameters. The first is the file handle,
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service