Perl/Shell scripting language

They are all script languages. They are executed directly after being written without compilation. Perl is used to process the parsing of a large number of texts. Shell is suitable for system management, such as automatic completion of a series of

Auto Build Environment with Perl/ant (3)

Several problems encountered in this process:First, run the Perl script directly in the command line. Everything is normal. You can also run the checkin and checkout commands in the version management software.The source code is automatically

Perl sorts a bunch of files by their names.

#! /Usr/bin/perl open DL, "list" | die "Open error $! "; % hash; while () { # Print $ _; my ($ A, $ B, $ C, $ d) = Split ('_', $ _); my ($ D, $ e) = Split (//. /, $ C); $ hash {$ _} = $ D; # Make a hash key and set the file name value to the

Some functions about strings in Perl

Search for substrings: Index () and rindex () These two functions are used to find strings in strings. The rindex function is the same as the index function, except that it is located later.There are two main usage options: Index ($ string, $

Usage of srand () and time functions in Perl

In Perl, srand () provides the random number seed for rand (). Rand () generates the random number generator.If srand () is not called before rand () is called for the first time, the system automatically calls srand () for you ().Calling srand ()

The beginning of Perl Learning

I have been engaged in some technologies and languages recently. I don't have time to update this place .. Some time ago, it took a long time to learn. net3.0, 3.5, and other related things, including LINQ and lamabda... when reading these

Use Perl use vars Pragma

Vars in Perl is a pragma (precompiled indicator) in Perl that is used to predefine global variables. These predefined global variables are in the QW () list, it can be used in the entire referenced perl file. Even if you use strict, no error is

Perl function pointer

It seems thatCode, Passed the test # ! /Usr/bin/perl Sub Func1 { Print " Func1 is running \ n " ;} Sub Func_test { My $ Func_ref = Shift ; # Ref will return 'code' if it's function reference If (( Ref ( $ Func_ref ) Eq " Code

Run EXE in Windows using Perl

The current project has just completed the compilation link of all components, and it is okay to run it. However, you have to double-click six programs (four window programs and two command line programs) each time you run the program ). I just want

Perl gets multiple rows after matching rows

#! /Usr/bin/perl Use warnings; Use strict; My $ flag = 0;My $;While () {If (/^> /){$ Flag = 1;$ A = 0;}If ($ flag){Print $ _;$ A ++;}If ($ A = 3){$ Flag = 0;}}############! /Usr/bin/perl-WUse strict;Open (logout, "> out. log") or die "can't create "

Fdupe: Find the Perl script code for duplicate files

Figure: Copy codeThe Code is as follows :#! /Usr/bin/perl # # Fdupe tool-finding duplicate files # # $ Id: fdupe, v 1.7 20:11:21 root Exp root $ # # Source code Copyright (c) 1998,2011 Bernhard Schneider. # May be used only for non-commercial cial

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 reads the path of the required file, and then opens the corresponding file

The following is a DNA sequence stored in F: \ perl \ data.txt under the window: Copy codeThe Code is as follows: aaaaaaaaaaaaaagggggttttcccccccc CCCCCGTCGTAGTAAAGTATGCAGTAGCVG Ccccccccggggggggaaaaaaaaaaaaattttttat AAACG The following is a

Code Analysis of a perl extension Regular Expression

Copy codeThe Code is as follows: my $ ip = "192.168.0.1 | 192.168.0.2 | 192.168.0.1 "; If ($ ip = ~ / ^ (? : ((? : \ D {1, 3} \.) {3} \ d {1, 3 }) (? = (? : \ | (?! \ 1 )(? 1) )* \ Z ) \ | )* (? 1) $ /X ){ Print "match \ n "; } According to the

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, "

Small Example of perl processing csv files

Copy codeThe Code is as follows :#! /Usr/bin/perl # Use strict; Open (FILE1, "C:/Perl/BX/BX-Users.csv "); Open (FILE2, "C:/Perl/BX/BX-Books.csv "); Open (FILE3, "C:/Perl/BX/BX-Book-Ratings.csv "); Open (result1, "> C:/Perl/BX/BX-Users.txt

Introduction to perl using variables for handling

Copy codeThe Code is as follows :#! /Usr/bin/perl-w Use strict; Use warnings; Use FileHandle; My % fh; My @ array = (1 .. 10 ); For (1 .. 5 ){ Open $ fh {$ _}, ">$ _. txt" or die; } For (1 .. 5 ){ # Print $ fh {$ _} "$ _ \ n"; Error $ Fh {

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

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