Perl language--Simple descriptionA simple explanationPerl language Full Name: Useful excerpts and report language | Morbid eclectic garbage list. The Perl name is not an abbreviation, but a retrospective.Perl language History: Larry Wall (Larry Wall)
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
1. Sub-ProgramDefine subroutines: The keyword sub, the subroutine name (not included with the number), and the block of code enclosed with curly braces, which is the main body of the program;Sub marine{$n +=1;Print "Hello,sailor number$n!\n";}The
#!/usr/bin/perl-w Usewarnings; UseStrict;my $usage= qq{$0INPUT_FASTQ trim_length}; die "$usage \ n" if scalar @ARGV!=2;my($FASTQ,$trim _length) =@ARGV;Open(FASTQ,$FASTQ) or die "Can ' t open $FASTQ \ n"; while(my $readid= ) { Chomp $readid;
Recently wrote a Perl script that implements the function of piecing together data from two columns in a table and then using the "|" Connected together.The table reads as follows:
Employee number
Employee Name
There was a time to learn python, very sad Ah, the version is too new, many things are inconvenient to use.Continue to use my little ***perl, I believe Perl will solve most of the problems I encountered!Statistical random number Occurrence frequency-
Chapter III: Naming conventions 0--three.use grammar templates when composing identifiers. The l variable is named after the noun, without or adding more than one adjective:variable→[adjective _]* nounL Hash and array:look-variable→[adjective _]*
The 18th chapter: Testing and debugging second-Qi.Write a test case first. Ii. Ba.standardize your test cases with test::simple or test::more. Nine.standardize your test set with test::harness. Ii. 0.Write a failed test case. three.both possible and
The Nineth chapter: one of the sub-procedures.call the subroutine with parentheses, but do not add & at the beginning. one.do not get the same noun as the built-in function. one third.to remove the @_ first. one of the restaurants.use a named
The seventh chapter: description document 0 BA.distinguish between user documentation and technical documentation. 0 ba.Create standard pod templates for modules and applications. 0 BA Land.extend and customize your standard pod template. 0 ba
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/(\.[\.]+) +([\
Reading standard inputStandard input with : Chomp ($line =);If the end of the file is read, the line input operator returns UNDEF. Can use this nature to jump out of the loop.while (defined ($line =)) {Print "I saw $line";}Abbreviated as:while ()
Scalar dataScalar: number, character. Can be stored in the scalar volume or read from files and devices.Numbers: All numbers have the same internal format-double-precision floating-point numbers.Floating-point Direct amount: The number that the
Meaning: Helping to understand the data structure of the object being depositedData::D umper with object-oriented and direct-use functions two methods of invocationThe function is called directly, for example:Use Data::D umper;My $a="Good";my $b="
Commands to enter the debug environment of Perl: perl-d perl_fileSet breakpoints: line numbers in the B + Perl code.Execute to Breakpoint: C represents continue until breakpoint.Executes the next statement, does not go out of the subroutine: N for
#! /usr/bin/perlUse Expect; #前提是你的服务器上得有Expect包, no installation, no use of interactiveMy $PROMPT = ' [\]\$\>\#]\s*$ '; # command Prompt mode for remote system@a = qw#100.100.100.200 root#; #假设你要登陆的主机ip是100.100.100.200 User is root$obj =
Perl Modules and Packages:Keywords related to modules:Use Module-name: Adding modulesUse Module-name qw/functionname/; #导入具体的函数Use Module-name qw//; #不导入具体函数, you need to call the function with a full pathUse Module-name {};
In Perl, you can create a subprogram (subroutine) by yourself ):
Keyword sub, subprogram name, and code block enclosed by curly brackets.
Sub marine {...}
The subprogram name is different from the scalar namespace.
Return Value of a subroutine:
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