Log4j perl error Log extraction

Log #!/bin/perl use Encode; Open (notesfiles, $ARGV [0]); my%errormeganotes; Print ">>>>>>>>>>>>>>", $ argv[0], ") { if ($_=~/^ (\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}) \s+error\s+ (. *) \s/g ) { if ($errorMeganotes {$}) { push @{$

Special variables in Perl

Special variables in Perl 1. $&, $ ', $ ' used in pattern matching $& is used to hold the value in the match$ ' used to hold all previous characters in match$' Used to hold all characters after the match Such as: #!/usr/bin/perl-w If " Hello

Use Net::smtp_auth to send messages in Perl.

1, send mail on an SMTP server that does not require authentication#!/usr/bin/perl-wUse NET::SMTP;$SMTP = net::smtp->new ($mail _server); #邮件服务器地址$smtp->mail ($send _user); #发件人$smtp->to ($recv _user); #收件人$SMTP->data ();$smtp->datasend ("Subject:

Accessing a database using Perl.net

perl| Access | data | The database is not just vb.net,c#. Microsoft's development software can invoke the. NET Framework, as far as I know, at least 28 of the development languages I knew how to invoke. Net Framework. Let me give you a case of using

Perl multi-process master process and other child processes end

"Use POSIX": Sys_wait_h ";" Remove, and it is wrong to print the variables in the subprocess in the main process, the main process does not know the status of the child process, unless you pass the value of the variable to the main process with a

@_ and $_ in Perl

1.@_ is an array of parameters that are placed when a function is passed, and you can take arguments from it, such as my ($para 1, $para 2 ...) =@_, when a function call is filled with several parameters, it is possible to take several parameters

Perl Learning (9) Process Management

One: SystemThe system function is the simplest way to start a Perl subroutine. Eg:system "Date"1: Can use Shell function to start background processSystem "Run_cmd with Parameters &"; #在后台执行2:system performs a normal return value of 0, otherwise the

Multi-threading and multi-process for Perl

Multi-process: With multiple PID, the memory is occupied independently.Multi-threaded: does not have a separate PID.Select: Multiple processes can be selected without the output of the shared variables, etc., when a partial independent generation of

Perl Language Learning Note 15 Intelligent matching and give-when structure

1. Intelligent matching operatorAlternative binding operators:Find a key in the hash: The comparison of two arrays is exactly the same: Find out if an element exists in the list: The smart match operator is independent of order. ~ ~ Around

Run_regress--perl

#!/usr/bin/perlPrint "Testlist File Name: @ARGV \ n";My $testlist = $ARGV [0];Open (Rd_file, "$testlist");@all_cases = ;# #TODO Add your commandMy $qsub _cmd = ""My $run _cmd;My $case _name;foreach $case (@all_cases) {# #remove Blank Lineif (! (

Perl Study Notes No. 7

Regular Expressions in Perl 1. It is a wildcard and can match any single character, except for line breaks. If you want to use. In the mode, use /. 2. * match the first item zero or multiple times, such as/AB * C/match AC, ABC, abbbbbc... 3. +

Solve the Problem of Perl calling system return values

The test script is as follows:   My $ run_app_path = "C: // exit_value.pl ";My $ ret_val = system ($ run_app_path );Print "system value is: $ ret_val/N ";$ Ret_val = $ ret_val> 8;Print "return value is: $ ret_val/N ";Exit 0;     The

Install the Perl CPAN module in Windows XP

1. Search for the required modules from www.cpan.org and download them. the download is generally in GZ or tgz format. 2. Extract and Compress With WinRAR and other software 3. In comman mode, enter the decompressed folder and the directory

Obtain and modify file attributes in Perl (Win32 System)

Sometimes we need to process some attributes of the file, such as read-only and hidden, Here I will explain how to obtain and modify the attributes of a file in Win32. Required: Use Win32: file; Use the following method: My $ set; #

Perl Study Notes No. 3

1. A given expression has different meanings in different contexts2. In the scalar context, Nums returns the number of its elements. In the list context, its elements are returned.3. Print @ Nums; each element is not separated by spaces unless print

Perl study note No. 1

1. Write the code and # Run the CHMOD 755 file name directly.2. debugging is also possible, # Perl-M file name3. Transfer characters only play a role in double quotation mark strings, and scalar variable interpolation is also the same4. Use a scalar

Perl Study Notes No. 8

Application of Regular Expressions 1. // is short for M //./http: // is not easy to read. You can write m {http: //} or M % http: // % 2. The forward slash is not a metacharacter. If it is not a separator, you do not need to use a backslash before

Perl Study Notes No. 13

1. $ where = index ($ big, $ small); the character position starts from 0. if the substring is found at the beginning of the string, index returns 0. if a character is followed, 1 is returned, and so on. if the substring does not exist,-1 is

Perl Study Notes No. 11

1. Die "Oops! A file named '$ filename' already existed! " If-e $ filename Use the-E Option to check whether the file exists before the system creates a file. 2. Warn "config file is looking pretty old! /N"If-M config> 28; # config is a file

Perl advanced features

9.1 search scalarSearch by indexIndex string, substringIndex string, substring, start_positionThe index function starts running from the left side of the string and searches for substring. To the position of the substring. 0 indicates the leftmost

Total Pages: 66 1 .... 59 60 61 62 63 .... 66 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.