Copy code code as follows:
#!/usr/bin/perl
My%scyjm;
Open (Contacts, "F:\\perl\\f.txt") || Die ("Can not open the file!");
while ()
{
Next if/^#/; #if ($_=~/^#/'s shorthand
; chomp;
My
Tables that manipulate CSV are often encountered in Perl processing files. Such a table resembles a two-dimensional array, so the actual operation of the two-dimensional array is done.For such rows and columns, we often need to follow a column, or
Two sets of code files are written, and the code functions in the group are the same:testv.pl vs Testv.cpptestreg.pl vs Testreg.cppThe code is as follows:testreg.cpp/////////#include #include #include using namespace Std;int main (int argv, char * *
Beginners Perl language, the first contact is not its syntax, but its debugging method, was due to a Perl script generated HTML page does not display properly, let me find out the cause of the problem, and then fix, was the first time to contact
When you write a small script today, you need to immediately output the current progress to the command line, and immediately write important data to the report file. But Perl by default is output buffered, display to the command line must be at the
To study a Perl script today, several of the regular ones are very confusing: $text =~ s/([?! ]) + ([\ \ \"\ (\[\? \? \p {Ispi} ]*[\p{isupper}])/$1\ n$2/g; #Multi-dots followed by sentence starters $Text =~s/(\.[\.]+) +([\
Soket is a network socket. It is a combination of IP addresses and port numbers. The socket module is required to use sockets in Perl. It can be used after testing: The following example is used for illustration: Server: #! /Usr/bin/perl-WUse
Http://developer.51cto.com/art/201007/211617.htm
This article will focus on the automatic conversion between Perl numbers and strings in the Perl language. Here we will introduce them from seven aspects, I believe you have learned a little
① File Operations
To read a string from a file using Perl, you can use either of the following methods:1. Read all the content in the file into an array at a time (this method is suitable for small files ):
Code highlighting produced by Actipro
According to Xiao Peng, first change the detection script of yesterday to the one with the reset function, and then send the alarm prompt to the specified mailbox by email.
Certificate ---------------------------------------------------------------
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
#
! /Usr/bin/perl-W
$ Line
=
Stdin
>
;
Chomp
(
$ Line
);
If
(
$ Line
= ~
/
(
^
[
-
Za
-
Redirects standard output and error output to the corresponding log file for any function.
Record the function running time for any function.
Code:
#
! /Usr/bin/perl
Use Warnings;
Use Strict;
No Strict
"
Refs
" ;
Sub
Reason
Looking back at Perl recently, on the one hand, my customer manufacturers developed a lot of things with Perl, on the other hand, they reviewed the Perl language and had some experiences. Record it for your reference.
I am working on a small
Suppose there is a sequence like this:1 21 22 11 31 41 54 1We need to get the following results:1 31 52 14 1Therefore, use the following perl script to implement it.
Code 1:
Copy codeThe Code is as follows :#! /Bin/perl
Use strict;
Use warnings;
My $
Copy codeThe Code is as follows :#! /Usr/bin/perl
My % scyjm;
Open (CONTACT, "f: \ perl \ f.txt") | die ("can not open the file! ");
While ()
{
Next if/^ #/; # if ($ _ = ~ /^ #/
Chomp;
My @ information = split; # my @ information = split/\ s +
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