"Original, do not reprint without permission"A hash is a data structure that is similar to and to a group in that it can hold any number of values and can be used on demand, and that the array is indexed by numbers, and the hashes are indexed by
Input and output: operator: Used to read data from STDIN:If you read the end of the file, the line input will return undef.$line = ; #读取下一行.Chomp ($line =); #去掉输入的一行的最后的换行符while () {print "$_";}foreach () {print "$_";}print function: used to output
Regular Expressions:The regular expression in Perl is called a pattern, which is a template that matches a string.Perl's regular expressions are similar to Shell/awk/sed/grep.m/pattern/Operation pattern Matching:/pattern/is the shorthand of
You can decide if make the output shown on command screens by using 2>&1 or NULTesting script:print "without null \ n";System ("dir 2>&1");print "with null \ n";System ("dir > NUL");print "End \ n";Result:C:\rebecca\script\perl\unicode>perl
#!/usr/bin/perl-w UseStrict; UseFile::Spec;Local$\ ="\ n";#each line of output of the current module adds a newline charactermy %options;#directory path$options{Single_case} ='/home/jiangyu/src/pl/example'; my @cases; if(-D$options{single_case})
0x00 backgroundA few days ago someone told a conference about a problem that existed in Perl for 20 years. It's really heartbreaking to be a person who will only Perl without Python. After watching the video feel black to eat nothing.This is like a
CopyCodeThe Code is as follows :#! /Usr/bin/perl
#
# Use grep map to obtain the Intersection Set and supplement set of the two lists
#
Use strict;
My @ A = ("A", "B", "C", "D", "E ");
My @ B = ("B", "g", "F", "E ");
Print "list a data: @ A \
Original article address:Http://blogread.cn/it/article/743? F = WB
I used Perl to write some monitoring scripts and put them in crontab for scheduling and execution. Sometimes you will find that a script runs for too long and starts multiple
A routines method in CGI. PM calls 1. cgi. PM to implement two usage methods: Object-oriented method and traditional perlmodule method. Object-oriented Method :#! /Usr/local/bin/perl-W use CGI; # Load CGI routines $ q = CGI-> New; # create new CGI
1. Change the Directory
Chdir "/etc" or die "can't chdir to '/etc '! \ N ";
If the parameter is omitted, the system returns to the user's home directory, which is the same as that of CD;
2. wildcard file name
My @ all_files = glob "*"; # files
In Perl, you can use the open or sysopen functions to open files and perform operations. Both functions use a file handle (that is, a file pointer) to read and write files.
The open function is used as an example:
1. Open and Close files
The return
This task counts the top 500 entries in a week.
Data source: from the Oracle database.
Requirement: generate an Excel file and send an email to the relevant person.
Because it was the first time that I was engaged in such a task (writing scripts on
I am very grateful to superor for taking his own time and providing the first Chinese video tutorial for the Chinese Perl community. It is a good tutorial in other languages. Compared with Perl, Perl is still relatively small. It is quite convenient
Recently, we have been struggling with the issue of how to release memory in Perl. Below are a few simple statements:
1. Perl-e 'for $ I (1 .. 10000) {$ hash {$ I} = 0; print "$ I \ t $ hash {$ I} \ n"; Delete $ hash {$ I };} for $ J (10001 .. 20000
Sorry, I saw the email in Gmail and then replied to the email directly. Then ...... "This is an automatic notification email. do not reply to this email directly ." Er ...... Paste it here.
Yes. What I am sending now is what I have. This part is
The default Perl debugger is the perl interpreter, and a GUI debugger.Generally, telnet is used to access the server during development. This document describes the usage of the default command line debugger.
Start the Perl interpreter with the-d
Sometimes we execute a script, because some programs in the script are suspended and time-out, which affects our judgment on the next step. At will, it is necessary to set the timeout settings for functions and processes so that they can return a
Apache and CGI are not explained here.1. apache download address: http://www.apache.org, the following uses 2.0.63 as an example to introduce the configuration of running CGI program.2. Download the Perl interpreter ActivePerl in Windows. Official
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