When you first started to learn Perl, write the program, ready to wait for the results output, the result of double click, see the Screen flash, and then nothing. There is no chance that you can see the results of the output.
How to solve this
When you create an array in Perl, you can use the QW.
But there is a problem, if you want to create an array of 20 names, and everyone's name is this form of "Join Smith" "Harry Potter" which means that each name contains both a surname and a name.
1. Remove duplicate elements from an array:
Using the GREP function code fragment:Code:
Copy Code code as follows:
My @array = (' A ', ' B ', ' C ', ' a ', ' d ', 1, 2, 5, 1, 5);
My%count;
My @uniq_times = grep {+ + $count {$_}
My first Perl script for the production environment, though not very good, has taken a solid step:)Leaders have tasks, to a number of IP list, ping each machine, if there is no response to send an email notification, the message needs to separate,
Copy Code code as follows:
#!/usr/bin/perl
#
# using grep map to get the intersection and set of two lists, the complement
#
Use strict;
My @a= ("a", "B", "C", "D", "E");
My @b= ("B", "G", "F", "E");
Print "List a data: @a \ n";
print
Http://hi.baidu.com/rdzwx/blog/item/6b52c9c4bdf70c179d163d81.html Perl halfwidth Conversion
# The first byte of the fullwidth character = 163 (0xa3), and the second byte is the corresponding halfwidth character + 128# Full-width Chinese
PHP and Perl are becoming enterprise-level PHP, Perl, and other scripting languages that are making remarkable progress at the enterprise level, in concert with traditional technologies. NET and Java. Will your enterprise be ready to adopt it?
1. Search for the required modules from www.cpan.org and download them. the download is generally in GZ or tgz format.
2. Extract and Compress With WinRAR and other software
3. In comman mode, enter the decompressed folder and the directory
()GroupExample: ($ fruit, $ color) =/(. *)/SIS/s (.*)/;Values in each bracket are returned values in the list.
= ~This operator does not assign values. It just extracts the operator on the right and enables it to operate on the variables on the
1. Perl uses use spreadsheet: parseexcel; and use spreadsheet: writeexcel; it cannot read or write the same Excel file at the same time.
Using Win32: Ole ---- for Windows seems acceptable, but not for Linux.
2. PerlFormulas and formats used in
Perl is a very powerful text processing language. When I was writing a Perl script, I basically solved it with notepad ++ and print.CodeEditing and debugging problems. Notepad ++ is actually a very good choice for the editor. It is very nice to
Perl has many built-in variables and columns for searching.
$ ARG$ _-The default input and pattern-searching space.$ -contains the subpattern from the corresponding set of parentheses in the last pattern matched.$ Match$ &-The string matched by the
9.1 search scalarSearch by indexIndex string, substringIndex string, substring, start_positionThe index function starts running from the left side of the string and searches for substring.
To the position of the substring. 0 indicates the leftmost
I. Three Forms of Regular Expressions
First, we should know that there are three regular expressions in the Perl program:
Match: M/;/(can also be abbreviated as/;/, skip m)
Replace: S/;/ ;/
Conversion: TR/;/ ;/
The three forms are generally equal
Because CME has a strong personality, it finally opened her, And suddenly found that CMO has too many jobs not yet done, version controlling, change management, Auto Release, configuration status announce. key area list, find out that, Auto Release
1. related functions and subroutine. In this book, the function refers to the Perl built-in function, and subroutine refers to the user-defined function. In essence, the function and subroutine are the same thing. Unlike Pascal, functions in Pascal
Comparison of Perl database insertion Methods: Python/ruby1. This article compares the three database insertion methods. A) execute $ something-> execute () cyclically, and control $ DBH-> commit (); B) $ something-> bind_param_array () and $ th->
A few days ago in Look At The ultimate_toolbox source code, from the codeproject down a compilation, a bunch of errors, found that because the compiler can not identify the ISO-8859-1 encoding, misunderstanding of the relevant characters caused, so
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