program annotations in Perl: Single-line and multiline comments(i) Single-line Comment:Lines beginning with # are considered by Perl as annotations. But with one exception, the first line of the Perl program begins with a #, and he specifies the
To include double quotes or backslashes in the string, add a backslash before it, and the backslash can also cancel the variable substitution
Single quotes another feature that can span multiple lines, such as:$text = ' This is twoLines of text';is
Question: I now want to add awk ' {print $} ' from_file > To_file to the Perl program, but after adding sytem and ', I can't do it.
Answer: There are a number of commands that can be executed at the command line, but they cannot be executed
Assigning values to lists
($fred, $barney) = ($barney, $fred); Swap the values of these two variables
@ references the entire array.
Note: When copying an array to another array, it is still the assignment of the list, but theseThe list is stored in
recently, I have been studying in some forums and communities to find out that many people have a lot of bias towards Perl. I've studied Perl for so long, and it's a little bit of experience, so I've summed up the reason why everyone is biased
If you want to call it directly in any directory, You need to configure its corresponding environment variables.
The following describes how to configure environment variables:
1. Java:
Download the JDK and install or decompress it.
Set
In my current project, it has some old code in Perl and new code in both Perl and PHP. the PHP and Perl code need connect each other, especially the session variables. currently, we need PHP to get Perl session variables.
Searching on Google,
I have been using Perl for my recent work.Program. Although Perl is not my learning direction, I still summarize some knowledge points I encountered at work for future use.
1. Define a hash (hash or associated array)% For = ("AAA" => "001 ","BBB" =
Seek sets the current location of the file!
When a file is very large, it can be read from a specified location.Seek filehandle, position, whence
Success returns true, failure returns false.Position is the new position (in bytes) to read ).Whence
1. the array name can be the same as the scalar name. // if you are not afraid of being dizzy, use it =. =2. The array is out of bounds only when the value is UNDEF.3. underline only serves to divide long numbers4. The index value of the last
1. Unless statement, if is executed when the condition is true, unless is executed when the condition is false
2. abbreviation statement. & error ("invalid input") Unless & valid ($ input); $ I * = 2 unitl $ I> $ J; print "", ($ n + = 2) while $ n
3
Reprinted from: http://club.topsage.com/thread-464914-1-3.html
Learning Perl
Perl is a very useful language and can be used to do many things. However, it is only a language that has mastered Perl. You only have mastered a small piece of knowledge
What is a closure? "This is a notion Out Of The LISP world that says if you define an anonymous function in a particle lexical context, it pretends to run in that context even when it's called outside of the context. "[2 ]. In the object-oriented
Translated by saladjonk
Audit: Qiang
Exit: Chinese Perl Association FPC (Foundation of perlchina)
Original Name: Perl circus: File Operation
Author: Luke Melia
Original article:
Table posting: 2002
Perlchina reminds you: please protect the
#! /Usr/bin/perl
Use strict;Use warnings;Use dBi;
Opendir (Dir, "dirpath/") | die "can not open it ";My @ connect = readdir (DIR );Closedir dir;
My $ dir_need;Foreach my $ con (sort @ Connect ){If ($ con = ~ /-[0-9] {2}-[0-9] {2 }_/){$ Dir_need = $
I haven't posted it for a long time. Today I am posting about the common functions of the lwp module.
(1) The most important function is to view the webpage source file. We can view the webpage source file through the existing methods of Perl, and
Recently, I had a program to automatically capture data from some BT websites and post it to my own forum. It worked better after a few months of trial, now the source code is published for reference by Perl enthusiasts. QQ is 2637663 and we welcome
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