wget http://www.cpan.org/src/5.0/perl-5.20. 1. Tar. -xzf perl-5.20. 1. Tar. gzcd Perl-5.20. 1./configure-des-dprefix=$HOME/localperlmakemake testmake InstallView CodeThis process takes about more than 10 minutesEdit the first Perl
PI is calculated mainly by Monte Carlo method. The code is as follows:1) pi.pl: $time 1 = Time (), foreach (1..20000000) { my ($x, $y) = (rand (), Rand ()); if (sqrt ($x * * 2 + $y * * 2) The Perl script runs as follows, and the average
If a scalar is the ' singular ' in Perl, as we described it at the beginning of Chapter 2, the ' pulural ' in Perl is Represen Ted by lists and arrays.A list is an ordered collection of scalars. An array was a variable that contains a list. People
Using a hash as a reference is deprecated at the template Example/index.html.ep line 8Using a array as a reference is deprecated at the template Example/index.html.ep line 8It's simple because the hash and array are not used correctly.%=% $entries->{
Perl That's been learning, and sometimes Perl doesn't understand it with Python, so maybe Perl understandsHere's a copy of the Python notation, a Perl version, of course, for learning, the download virus is a little too simple.The backdoor.sh
My personal understanding is that when a variable goes out of scope, it should be gone and gone, but you can still access it, which is the closure.## Look at the example below.# !/usr/bin/env perl-w Use Strict; { my$value'abc';} Print $value;
#!/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
What?Perl , a feature-rich computer programming language that runs on more than - computer platforms, ranging from mainframe to portable devices, from rapid prototyping to massively scalable development. Why?Perl The pursuit of simple and fast
In BI report development, often need to calculate the year-end, need to use the month-end date, with the date function of the database system needs to be in each place to use the date to write the function, in some special cases, the function will
Eighth chapter: Built-in function 0 nine-Qi.do not recalculate the sort key in sort. 0 Jiu Ba.use reverse to reverse the list. 0 Jiu Jiu.use scalar reverse to reverse the scalar. 00.use unpack to remove fixed-width fields. one 0.use Split to remove
Array:Special array index: Adds an assignment to an element whose index value exceeds the end of the array, which is automatically expanded as needed as long as there is available memory allocated to the array. The value of an unexpectedly
Alex Suykov had do some work for this purpose, and my compile script was based on her patch.Stepsstep 1:Download Perl source code from Perl ' s official site, such as:
wget http://www.cpan.org/src/5.0/perl-5.20.2.tar.gz
Step 2:Download
Regular expressionsSimple mode: Matches the contents of the $_, just write the pattern in a pair of slashes (/).such as: #!/usr/bin/env PerlUse 5.010;$_= "Yabba dabba Doo";if (/abba/) {Say "it matched!";}About meta characterssimilar to the Shell :.==
One day when wandering around saw a pair of motion diagram: Really is very greedy, all kinds of turning all kinds of eating, feel very interesting.Use Perl to achieve automatic eating full, premeditated, before the character of the snake,
Occasionally write Perl script, with Eclipse open too slow, NotePad bar, color is too monotonous, notepad++ is undoubtedly not a good choice, but when you want to input Chinese comments, often jam very uncomfortable, and finally choose to use
The "Perl 5 to 6 translated version" issued in this post for three consecutive weeks has been completed. Thanks to the support of Py (ask him if he cannot understand English in many places ). if there is something wrong with the translation, please
#! /Usr/bin/perluse Mail: Sender; # A new sender defines the encoding format to prevent garbled characters. my $ sender = new Mail: Sender {ctype => 'text/plain; charset = utf-8 ', encoding => 'utf-8', };# die "Error in mailing: $ Mail: Sender:
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