Perl is a practical summary and reporting language that is popular with developers around the world, and although it was born and developed on Unix, it has a niche in the area of Windows programming.
Under the leadership of companies such as
This free universal space supports asp,.net,php, CGI, Perl, Ruby, Python, SSI, and provides 2 MySQL databases free of charge.
Xiushan Hotline offers 200M universal free space ApplicationThe free universal space size is: 200MB;
No limit of flow;
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.
Work needs to start with Perl, download a window version (5.16): Download linkHttp://www.activestate.com/activeperl/downloadsOnce installed, write the first Perl program
Copy Code code as follows:
#!/usr/bin/perl
print "hello,world!\
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.
#mode operand Create truncate#read #write > Yes#append >> Yes
Case 1:throw A exception if you cannot open the file:
Copy Code code as follows:
Use strict;
Use warnings;
My $filename = ' data.txt ';
Open (My $fh, ' Or die
The main function of the SSH limit perl script is:1. Limiting the maximum number of logons for an SSH user is n,n customizable.2. Support White list, such as root, test login is not restricted.
If an SSH user's maximum number of logons exceeds a
Method one, manual installation steps
Download the DBI Module version 1.13 of the compressed file dbi-1.13.tar.gz from CPAN, assuming it is under/usr/local/src/.Cd/usr/local/srcUnzip this file:Tar xvzf dbi-1.13.tar.gzA new DBI-1.13 directory is
Original title:
Q: There are a.txt files, which are as follows 1234569 ABCABCABC requires awk to print the following results 987654321 CBACBACBA
A:
Shell: [Root@vps tmp]# rev A.txt 9654321 CBACBACBAPerl: [Root@vps tmp]# perl-nle ' Print scalar
Perl:warning:Falling back to the standard locale ("C").
Perl:warning:Setting locale failed.
Perl:warning:Please Check that your locale settings:
LANGUAGE = (unset),
Lc_all = (unset),
LANG = "ZH_CN." Gb2312;zh_cn. Utf-8;en_us;en_us. UTF-8 "
are
To re-assign each array element with a For loop:#!/usr/bin/perl@array = (1..30);p rint "@array \ n"; for ($i =0; $i Re-assigns each array element with a while loop:#!/usr/bin/perl@array = (1..30), $count = 1;print @array, while ($count Re-assigning
Summarize: Q (), QQ (), QW (), QX (), respectively, are single quotes, double quotes, create string lists, and capture command output. 9th hours other functions and operators
One thing can be done in a variety of ways. The main contents of
A short Perl program allows for large functions.How does Perl do that?1. Default variablesIf no parameter value is supplied to the function, the default parameter is $_;If no variable is used to receive the value of an expression, the default
Many times, we want to make certain changes to the content of the original file, although Linux has sed this powerful text editing command, but he can only generate new files or print to screen (perhaps Sed also has the function of modifying the
Yum installs Cpan and YAML-related packages:Yum Install Cpan perl-yaml*Update Cpan to the latest version and reload CPAN:[[email protected] ~]# cpan Enter ' h ' for help.cpan[1]> install cpancpan[2]>reload CPANModify the site of the CPAN Mirror
ProgramFile: test. pl
CopyCode The Code is as follows :#! /Bin/perl
# Filename: Test. pl
Use strict;
Use warnings;
# Search for a sequence that is better recognizedMy $ DNA = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ n ";My $
Perl is a high-level, general-purpose, interpreted, dynamic programming language. it was originally developed by Larry Wall in 1987 as a general-purpose UNIX scripting language to make report processing easier. it borrows features from other
Why use references?
In perl4, the value field in the hash table can only be scalar, not list, which is inconvenient in some cases, such as the following data:Chicago, USAFrankfurt, GermanyBerlin, GermanyWashington, USAHelsinki, FinlandNew York,
Operate (generate) Excel on Linux or Unix. CPAN provides the Spreadsheet: WriteExcel and Spreadsheet: ParseExcel modules.
Let's take a look at how to use Spreadsheet: WriteExcel and Spreadsheet: ParseExcel.
First, install the corresponding modules
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