Scripting function: To detect the specified domain name by using ICMP ping or Tcp/syn to detect the validity of the domain name before probing.
file:check.host.pl #!/usr/bin/perl use strict;
Use Net::P ing;
Use Net::D ns;
Use Time::hires qw ();
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
Everyone in Perl really like to use the split function, which is very useful, but there are two aspects to note. I will give an example to illustrate it.
My $ message = "word | words ";My @ word = Split ('/|', $ message );Print $ word [0];
The
About sleep functions in Perl
Sleep exprSleepThis function allows the script to sleep for expr seconds. If there is no expr, it will be permanently sleep and will return sleepNumber of seconds. You can send a sigalrm Method to the process to
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,
Address: http://blog.chinaunix.net/uid-28671666-id-3554676.htmlPerl Learning Method
Take notes, "a good memory is not as good as a bad pen", the concept, method, skills and other important content must be recorded, so as to deepen the impression
A Perl script was written a few days ago :? Operator encountered a very strange problem
$ Data-> {$ id}-> {'Total '}?$ Data-> {$ id}-> {'ratio '} = sprintf ("%. 2f % ", 100 * $ data-> {$ id}-> {'succ'}/$ data-> {$ id}-> {'Total '}):$ Data-> {$ id}->
I. Concept of reference:
Perl provides a data type similar to the pointer function in C/C ++, called reference. This reference is different from the reference concept in C ++, but the effect is the same; references in Perl are pointers used to trace
In item 116 of the book "valid Perl", author demonstrates how to use unpack to process fix-width columnar data.I tried to write a toy code for practice, and found two things need to note.
First thing, must use single quote 'before and after the
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
Code idea: Construct a tree based on the given two traversal sequences, and then traverse the remaining traversal.
Root traversal + root Traversal
#! /Usr/bin/perl-W use strict; Use List: util QW (first); Use 5.010; my @ tree;
#! /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 = $
$-Number of printable lines on the current page, part of the perl format system $! Return Error code or error String Based on the context content $ "list separator $ # default digital output format when printing numbers $ process ID of the perl
1 Perl Automatic Detection
1.1 Command Line Detection Method
You can add the-W parameter to the command line parameters of the first line of the program, as follows:
#! /Usr/local/bin/perl-W
1.2 internal Detection Method of Perl Program
Add the
Use format and common methods (general methods for parent class IO: handle and IO: file are not described below ):========================================================== ========================================================== ==================
I haven't written a Perl script for a long time. Recently, my computer has the prison break audio and SRT lyrics. However, the lyrics are incorrect. After the script is processed, you can change your voice to subtitles. It is mainly used to review
The company's billing is not based on access logs. However, the original access logs are the most trusted resources,
It is often used to test various parameters, such as traffic.
Log format:
222.85.90.158--[01/SEP/2012: 00: 00: 00 +
Use XML-writer
#! C:/perl/bin/Use XML: writer;Use IO;# Open file stream. Param is file name.My $ output = new IO: file ("> output. xml ");# New A output stream.My $ writer = New XML: writer (output => $ output)Or die "create fail ";Print "file
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