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
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
#! /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
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, $
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 ()
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
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
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
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
#! /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 "
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
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
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
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, "
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
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
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