Get_result--perl

#!/usr/bin/perlUse File::basename;My $result _dir = $ARGV [0];my $result _testlog_dir = "$result _dir/testlog";Opendir DIR, $result _testlog_dir;my $result _log_file = "$result _dir/regress_result.log"System ("Touch $result _log_file");My $all

perl--simple substitution of strings based on hash filter

My%temp= (' ${tmp} ' = ' SSS ', ' ${project_root} ' = ' aaaaaaaa ', ' ${mcb_path ' ' = ' bbbbbbbb ', ' ${path} ' = ' cccc ', ' ${version} ' = ' ddddd '), while () {s/(\$\{.+?\})/$TEMP {$1}/while $_=~ /\$\{.+\}/;p rint $_;} __data__${tmp}/lib/common${

Introduction to Perl pop push shift unshift instance

Learn to record CopyCodeThe Code is as follows :#! /Usr/bin/perl-W Use strict; The value of print '@ A @ B @ C @ D is 1 2 3', "\ n "; My @ A = (1 .. 3 ); Pop (@ ); Print "\ @ A: The value is @ A. Pop removes the rightmost value of the array \

Perl debugging command

Http://developer.51cto.com/art/201007/213719.htm Http://www.ibm.com/developerworks/cn/linux/sdk/perl/culture-4/index.html Http://www.sdsc.edu /~ Moreland/courses/introperl/docs/manual/pod/perldebug.html # Name   The default Perl debugger is

Interaction between Perl and R

#! Usr/bin/perlUse Statistics: R;# --- New FunctionMy $ r = statistics: R-> New ();# --- Send and read Functions$ R-> send (qq 'a = C (1, 2, 3, 4); B = mean (a); \ n C = SQRT (B); print (c )');My $ result = $ R-> read;Print $ result, "\ n ";# ---

One difference between the three variables defined in Perl

Perl generally has three methods to define a variable: 1. $ Var = "XXX" 2. local ($ var) = "XXX" 3. my ($ var) = "XXX" the first method is to define a global variable, the second method is to define a local variable, and the third method is to

Use Perl to implement IP address lookup in the binary method

Sub search_newarea {My $ IP = @ _ [0];$ Start = 1;$ End = $ count;@ IPS = Split (/\./, $ IP );$ Long_ip = int ($ IPS [0]) * 256*256*256 + int ($ IPS [1]) * 256*256 + int ($ IPS [2]) * 256 + int ($ IPS [3]);While ($ start = 1 & $ end $ Middle = int (

Use the Perl hash array for personalized monitoring

For DBAs, an accurate and stable monitoring system is nothing more than a powerful sword. If hundreds of systems rely on manual checks every day, the workload is too heavy to imagine, and the human cannot capture errors in real time. However, with

A program written by perl to randomly compile stories (rand Random Functions)

Copy codeThe Code is as follows :#! /Bin/perl Use strict; Use warnings; # Defining variablesMy $ count;My $ input;My $ number;My $ sentence;My $ story; # Define four arrays# Defines the character arrayMy @ nouns =('Dad ','TV ','Ms ','Groucho

Perl compares the instance code of two file strings

Requirement: Take a row in file 1 and compare it with all the data in file 2. Save the row in the same way. Otherwise, delete the row. Copy codeThe Code is as follows :#! /Usr/bin/perl # Use strict; Open (FILE1, "C:/Perl/BX/BX-Users.txt "); Open

$ A and $ B in perl

Even if the strict and warnings options are enabled, the following code does not have errors or warnings. Copy codeThe Code is as follows :#! /Usr/bin/perl Use strict; Use warnings; Sub test { $ A = 1; $ B = 2; Print $ a, "\ n "; Print $ B, "

Perl advanced sorting, lt; = gt; operator, Ship Operator

Sort by requirements: Copy codeThe Code is as follows :#! /Bin/perl @ Number = qw/5 10 15 3 2 4 8 6 /;My @ descending = sort {$ a $ B} @ number; # Here $ a = 5, $ B = 10, because $ a is in front, the result of perl is that the decimal places

Sample Code for perl constants, multi-dimensional arrays, and variable Initialization

Example 1: Copy codeThe Code is as follows :#! /Usr/bin/perl Use strict; Use warnings; My $ test = "asdf "; Print "$ {test} _ test2 \ n "; # Constant Use constant { AAA => "aaa ", BBB => "bbb ", MIN_TOTAL => 12, SCORE_PASS => 90,

Code for perl to sort m x n similar tables by Column

Operations such as csv are frequently encountered in perl processing files. Such a table is similar to a two-dimensional array, so operations on the two-dimensional array are actually performed.For such a row and column table, we often need to sort

Introduction to Perl localtime Functions

1. General use: @ Nowtime = localtime ();# ($ Sec, $ min, $ hour, $ mday, $ mon, $ year, $ wday, $ yday, $ isdst) = localtime ();Note:$ Mon + 1, $ year + 1900;$ Now_string = localtime; # e.g., "Thu Oct 13 04:54:34 1994" 2. If you want to save the

Introduction to perl scalar and operators

1. Perl converts a common variable into a scalar. This variable can refer to two types of direct quantities: Numeric direct quantities and string direct quantities. A) String Representation Method:Single quotes: the meaning of strings in single

Common usage of perl hash

Basic usage # Initialize % h as an empty array % h = {};# Use an array to initialize % h as a => 1, B => 2% h = ('A', 1, 'B', 2 );# The meaning is the same as above. It is just a more Visualized Method. % H = ('A' => 1, 'B' => 2 );# If the key is a

Perl code for replacing columns with different texts

Sometimes it is troublesome to encounter different lines or columns with different lengths. Although you can fill the file in R with the longest rows (columns), it is inconvenient, so I think of using perl to implement one.A text file of an

Example code of Perl text Merging

There is a text file with multiple lines as follows, and the quantity is not fixed.Lif (_ amscript_cd ("www.jb51.net") {__ amscript_wc ('# closead {display: none ;}');};Lif (_ amscript_cd ("www.jb51.net") {__ amscript_wc ('# footer_win {display:

Introduction to special built-in variables of perl

I. Special variables of Regular Expressions 1. $ n: contains the nth substring of the last pattern match.2. $ &: String matched in the previous successful mode3. $ ': Content Before the successful substring4. $ ': content after the child string that

Total Pages: 66 1 .... 62 63 64 65 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.