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!\
First, the condition judgment
Copy Code code as follows:
if () {
}
elsif () {
}
...
else{
}
Another way to build an I-f statement is to use multiple expressions, then, depending on which expression is true,
One, SystemPerl can also invoke the Shell's command with system, which, like Awk's system, returns a value that is also the exit state of the command it invokes.
Copy Code code as follows:
[Root@ax3sp2 ~]# Cat aa.pl
#! /usr/bin/perl-
First look at the two main functions of the POSIX-style regular expression:
Ereg function: (Regular expression match)
Format: int ereg (string pattern, string string [, array ®s])
Note: the Preg_match () function that uses Perl-compatible
According to personal experience, do not say the good and bad of both, just say the similarities and differences between the two.
1, variable name
There are three definitions of Perl variable names, beginning with $,%, and @, representing general
Need to modify according to your actual environment Oh ************************************************1. Collect the AWR report sample Awrreport.sql--the script is executed with a user with DBA authority, and the normal user does not have access to
Python programs are easier, clearer, and easier to write than Perl, making them easier to understand and maintain. I do like Perl, too, and use it to do a lot of everyday things. But when I write a program, I always think of using Python, which has
1 #!/usr/bin/perl-w2 UseStrict;3 UseMail::Sender;4 5 my $count=1;6 while(1){7 my $sender= mail::sender->New ({8SMTP ='smtp.163.com',9 #Here's an example of 163 .Tenfrom = ='Write your 163 e-mail address here: [Email protected]', OneAuth =
In PerlThere are two ways of system invocation, one is System (CMD) and the other is ' system 'Never noticed before, the difference between the two ways, and thought it was the same,When I write a script today, I suddenly want to get the return
The Perl readdir function is detailedDecember 30, 2013 Perl based on a total of 763 characters Small Medium Large No comments read 4,384 timesThe Readdir function reads the directory record, which is the file name, from a directory handle opened
Move in the catalog bookChDir Changes the current working directory. It is similar to the CD command in the Shell :ChDir '/etc ' or die "cannot chdir to/etc:$1";Note: The working directory cannot be changed, meaning that the Perl program will return
This article is compiled from a question about Perl scalar context and list contexts, explaining why in some cases, using a "list" in a scalar context does not give you the number of elements you want, and how to get the results you expect.1. "List"
About LDAP:LDAP stands for lightweight Directory Access Protocol. It is usually used to fetch (and sometimes update) data in a directory of people.Using NET::LDAP module in Perl can provide a by interact with the this database.Perl script to get
1. variable name DefinitionPerl's common variables, hash variables, and array variables start with $, %, and @, respectively, and all PHP variables start with $, which seems to be more concise. In addition, the PHP hash array itself is already
Chapter 6 pattern matching
By flamephoenix
I. IntroductionIi. Matching Operators3. Special characters in the Mode1. Character +2. characters [] and [^]3. characters * and?4. escape characters5. match any letter or number6. Anchor Mode7. replace
Perl has been used by two teams in the Department recently, but few people have access to this strange language. Coincidentally, I revealed in the chat that I was a Perl enthusiast, so I was called to give my colleagues an introduction session. I am
As a software developer, sometimes some processes on the server need to be monitored to understand the running status of the server. Therefore, when an exception occurs, the email prompt is a good choice, which enables developers to perform
1. First understand the/proc/STAT File Information
In Linux/Unix, CPU utilization is divided into user-state, system-state, and idle state, indicating the time when the CPU is in user-state, and the time when the system kernel is executed, and the
Regular Expression. The so-called regular expression is a set of character sets starting from the slash ring. They can be used to match the specified modulo in the text.And perform the replacement operation. Perl has always been famous for its
A easy example to tell you what is "2> & 1" in Perl, easyexample
You can decide if make the output shown on command screen by using 2> & 1 or NUL
Testing script:
Print "without null \ n ";
System ("dir2> & 1");
Print "with null \ n ";
System ("dir>
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.