Transferred from your original blog on yourblog, written on 13:05:48
After reading jackey's "bugzilla installation in Windows", the installation is successful according to the method described in this article. However, jackey does not seem to be
When you first started learning Perl
ProgramWhen you are ready to wait for the result to be output, double-click the result and you will see the screen flashing, and then there will be nothing left. You have no chance to see the output.
How can
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 \
1. Chop and chomp Functions
Both functions use strings as parameters and remove the last character from them. The difference is that, no matter what the last character is, chop will be removed and returned in the return value. Only when the last
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
Three Regular ExpressionsCommon pattern in Regular Expressions 8 principles of Regular Expressions
Regular Expressions are a special feature of the Perl language and also PerlProgramBut if you can master it well, you can easily use regular
Preface
According to the Perl Language Reference Manual, Perl isPractical Extraction and Report Language(Practical report extraction LanguageIt is designed by Larry Wall and constantly updated and maintained for programming in UNIX environments.
Posted on Netease blog 13:07:36
1st and 2nd
#! Perl-W# Chapter 4, exercise one and twoUse strict;Sub Total {My $ sum;Foreach $ _(@_){$ Sum + = $ _;}$ Sum;}My @ Fred = (1, 3, 5, 7, 9 );Print "sum of (@ Fred) is: \ t", & total (@ Fred), "\ n ";
Print "
Chapter 2: subprocesses/functions
Declaration: subfunction_name;
Definition: subfunction_name {...}
Function call is the same as C:
Example_subroutine (); or example_subroutine;
Example_subroutine ('perl is ', 'my favorite', $
The eq operator enforces the string context and treats its operations according to the string. = The operator forces the value context.
In rare cases, there is no suitable type operator, and you may need to explicitly force context. Force the value
Suppose there is a sequence like this:1 21 22 11 31 41 54 1We need to get the following results:1 31 52 14 1Therefore, use the following perl script to implement it.
Code 1:
Copy codeThe Code is as follows :#! /Bin/perl
Use strict;
Use warnings;
My $
Program comments in Perl: single-line comments and multi-line comments
(1) single line comment:All rows starting with # are considered as comments by perl. But with one exception, the first line of the perl program starts with #. It specifies the
Copy codeThe Code is as follows :#! /Usr/bin/perl
My % scyjm;
Open (CONTACT, "f: \ perl \ f.txt") | die ("can not open the file! ");
While ()
{
Next if/^ #/; # if ($ _ = ~ /^ #/
Chomp;
My @ information = split; # my @ information = split/\ s +
Method 1 (do not use modules, by agonyr)
Copy codeThe Code is as follows :#! /Usr/bin/perl-w
Use strict;
My @ seq = ("A", "T", "C", "G ");'My $ length = 10000;
Undef my % hash;$ Hash {"A"} = int ($ length * 0.3 );$ Hash {"C"} = int ($ length * 0.3
At the beginning, I plan to use perldoc to view the Apache2: Request module. The following error occurs during running:
Copy codeThe Code is as follows: Error in tempfile () using/tmp/XXXXXXXXXX: parent directory (./) is
Not writable
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
The pop operation extracts the last element of the array and returns the result:
@ Array = 5 .. 9;$ Fred = pop (@ array); # $ fred gets 9, @ array is (,) now)$ Barney = pop @ array; # $ barneygets8, @ array is (5, 6, 7)Pop @ array; # @ array: (5, 6)
A Conversion Program simply converts A in the DNA sequence to T. In the first case, private variables are not used.
Copy codeThe Code is as follows :#! /Bin/perl
# Below is a DNA sequence
$ DNA = ATTATATAT; # Here is our sequence
$ Result = A_to_T ($
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.