Perl reads multiple lines of text at a time. perl reads multiple lines of text at a time.
When processing text, we often encounter the following situation: we need to compare the two lines of text and then output them selectively. By default, only one row can be read at a time in the while (
There is a text like this:
A 1 2 3 4A 5 6 7 8A 6 7 8 9A 7 8 9 11A 7 8 9 12A 13 12 14 15A 18 14 16 17A 2 3 4 65
The r
When you're learning Perl, it's hard to care if Perl is obsolete. Is this version already obsolete?
For the previous question, it may be useful to refer to the February 2012 Tiobe report, according to which we can see that Perl has been a downward trend since 1997, but we can also see that Perl has been in the top 10
Preface
Sometimes there are these requirements:
1. count the number of rows of a file
2. Calculate the number of valid lines of a source code. Exclude empty and comment rows
3. Unify the quantity and number of files in a directory
Many languages can achieve these needs, but using Perl should be a good choice.
Number of lines reading files
It's easy to use Perl to read the total number of lines in a file (
sense of awe of those weird symbols >=
For the bioxxx aspect, actually very similar, only the Community activity degree is different. At least I have seen and used many of the procedures and analysis process, Perl is mainly used for small scripts, Python is often used for pipeline concatenation and some analysis method implementation, R is mainly statistical and results visualization (with Bioconductor), as for the output of SVG, It is basically l
integrates the C language structure, sed regular expression, AWK's associated array (associative array), and Lisp's table (list) and Unix Shell commands, in addition to a language, do you know which?" The colon suddenly sold a token.
Comma conjecture: "It should be an OOP language ."
"Perl does have many shadows of C ++, but its object model was introduced only after 5.0. The typical half path is far less natural than the previous features. It is not
language structure, sed regular expression, awk's associated array (associative array), and lisp's table (list) and Unix shell commands, in addition to a language, do you know which?" The colon suddenly sold a token.
Comma conjecture: "It should be an OOP language ."
"Perl does have many shadows of C ++, but its object model was introduced only after 5.0. The typical Half path is far less natural than the previous features. It is not so much a natura
concise and obscure, Python is elegant and clear, Ruby is exquisite and clever, and PHP is concise and simple. Let's take a look at the big brother Perl, which is widely used. It integrates the C language structure, sed regular expressions, AWK's associated array (associative array), and Lisp's table (list) and Unix Shell commands. In addition, it also draws on a language. Do you know which one is used?" The colon is suddenly sold.
Comma, I guess: "
problem has been solved.
We also have reason to believe that Perl/Windows integration will be further developed. Microsoft has become a major contributor since the beginning of Windows Perl Development. this fact is sufficient to prove Microsoft's commitment to Perl support. According to the three-year investment agreement recently signed between Microsoft and
1.PERL4 Kinds of variablesScalar: $ pure variable, scalarArray: @Hash:%File: Uppercase2. Variable composition1. Naming rules case sensitive, alphanumeric underline ...2. No keywords, $+ other, but can not conflict with built-in variables.3. The name length is infinite.3. In pure variables: integer, float, character, string,Integer variable1. You can use _ to divide character numbers2.012 is octal 103.0X1F is 16 binaryFloating-point variable1.11.42.-0.33..3can represent a 15-bit valid number, tru
1. Module source: Pack and download from CPAN together with the Perl release version
2. Read the module documentation: perldoc CGI
3. Installation Module
Makemaker mode:
Specify the installation directory:
Module: Build mode:
CPAN method:
4. File: basename Module
5. Select only some functions of the module.
Import the reference list.
10. Do not introduce any function
Use the full name:
11. File: spec Module
12. cgi.
most concerned about now is the 'p language ': PHP, Perl, Python, and Ruby ."
Question mark suggestion: "As dynamic languages, their commonalities have been discussed a lot in the previous lesson. can you tell me their personality ?"
"Their personality is extremely clear: Perl is concise and obscure, Python is elegant and clear, Ruby is exquisite and clever, and PHP is concise and simple. Let's take a look
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content: laxatives.
First, my personal claim is: python!
Three years of experience in biol
.
Perl is concise, complex, powerful, flexible, free, obscure, expressive, but normative, readability, consistency, cleanliness and maintainability is poor.
Python is elegant, concise, easy to learn and easy to use, class library rich, but less efficient, some people do not like its white space character sensitivity.
Ruby's syntax is sophisticated, highly flexible, with both
."
"Perl does have many shadows of C ++, but its object model was introduced only after 5.0. The typical Half path is far less natural than the previous features. It is not so much a natural development as a kind of self-help catering to the OOP trend. It is natural language to learn more from bone marrow ."ColonAccording to the answer, "we mentioned that Larry Wall, the inventor of
Original Name: Brian's Guide to solving any Perl Problem
Moderate: Brian's omnipotent guide to Perl issuesPrepared by: Brian D FoyOriginal article: http://www252.pair.com/comdog/brian's_guide.podOutput table:Translation: KlausAudit: QiangExit: Chinese Perl Association FPC-perlchina.orgRead this guide and stay informed
My debugging Philosophy I believe there are t
than one way to do it
This leads to the loose and random Syntax of Perl. The same thing is often written in a variety of different ways, and some seem strange,
In terms of syntax, Perl has many symbols, making it hard to learn and forget Perl to a certain extent.
This article briefly introduces the basic syntax o
development cycles.II. What does I need to know before learing Perl?To be honest, it's not a good choice if your start with Perl when you know nothing about computer programing. In some ways Perl are over free, which may give the learner an illusion so you can write the code on any the. Unfortunately, there is still borders. If you ignore these limits, your code
will undoubtedly become part of the future development of windows.If you are looking for more information about Windows Perl, you can find many excellent websites on the Internet, including:ActiveStatePerl.comAldo calpini single; s Perl labRoth consulting Perl pageEvangelo prodromou single; s Win32 Perl FAQRobin si
once ($a = ' string string2 '; $a =~ s/string//; causes $a = ' String 2 ').· Principle 4: Regular expressions can handle any and all characters that double quotes can handle ($a =~ m/$varb/Extend Varb to variables before matching, if $varb = ' a ' $a = ' as ', $a =~ s/$varb//; equivalent to $a =~ s/a//; The result of the execution is $a = "s").· Principle 5: The regular expression in the evaluation process produces two cases: the result state and the reverse reference: $a =~ m/pattern/Indicates
."
· Principle 8:perl provides extended functionality for regular expressions using (?..) syntax. (This point invites students to see the relevant information after class)
Want to learn all these principles? I suggest that you start with a simple beginning, and try and experiment constantly. In fact, if you learn $a =~ m/error/is looking for substring ERROR in
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.