Instance code for Perl constants, multidimensional arrays, and initialization of variables _perl

Example 1: Copy Code code as follows: #!/usr/bin/perl Use strict; Use warnings; My $test = "asdf"; print "${test}_test2\n"; #constant Use constant { AAA => "AAA", Bbb=> "BBB", Min_total => 12, Score_pass => 90,

Special variables in Perl

Special variables in Perl 1. $&, $ ', $ ' used in pattern matching $& is used to hold the value in the match$ ' used to hold all previous characters in match$' Used to hold all characters after the match Such as: #!/usr/bin/perl-w If " Hello

Use Net::smtp_auth to send messages in Perl.

1, send mail on an SMTP server that does not require authentication#!/usr/bin/perl-wUse NET::SMTP;$SMTP = net::smtp->new ($mail _server); #邮件服务器地址$smtp->mail ($send _user); #发件人$smtp->to ($recv _user); #收件人$SMTP->data ();$smtp->datasend ("Subject:

Accessing a database using Perl.net

perl| Access | data | The database is not just vb.net,c#. Microsoft's development software can invoke the. NET Framework, as far as I know, at least 28 of the development languages I knew how to invoke. Net Framework. Let me give you a case of using

JavaScript implements Perl-style variable substitution

Perl-style variable substitution has better readability, and common JavaScript programming with a lot of + number, dazzling. The good news is that we can use regular expressions to help implement a programming-style transformation. The following

Perl multi-Process read-write text

Using Perl to dispatch SQL scripts, in the process of opening a number of processes, I found that Perl write log file order disorder, do not want to engage in multi-threading programming so troublesome, my processing method, the corresponding file

@_ and $_ in Perl

1.@_ is an array of parameters that are placed when a function is passed, and you can take arguments from it, such as my ($para 1, $para 2 ...) =@_, when a function call is filled with several parameters, it is possible to take several parameters

CENTOS6 offline installation mysql5.5.55-1 (with installation package and Perl dependency package)

resource Pack Download Https://pan.baidu.com/s/1U3myYp4GSmDUfZocMWI9FA password: Xdac Resources that are provided with the resource bundle1. Upload mysql-client-5.5.55-1.linux2.6.x86_64.rpm, mysql-server-5.5.55-1.linux2.6.x86_64. RPM to Linux 2.

Perl Learning (9) Process Management

One: SystemThe system function is the simplest way to start a Perl subroutine. Eg:system "Date"1: Can use Shell function to start background processSystem "Run_cmd with Parameters &"; #在后台执行2:system performs a normal return value of 0, otherwise the

Unix and Linux installation Perl

The Perl installation steps on the Unix/linux system are as follows: Open http://www.perl.org/get.html through the browser. Download the source package for Unix/linux. After you download the perl-5.x.y.tar.gz file, perform the

Introduction to Perl Language-4th Chapter-sub-Program

subroutine definition and return valueSub sum{ print" called sub-program \ n"; $a $b # The latter behavior returns a value }$a=1; $b=; $s # 34 Calling SubroutinesSub-program parameters, parameters fixed (The following example can only 2

Multi-threading and multi-process for Perl

Multi-process: With multiple PID, the memory is occupied independently.Multi-threaded: does not have a separate PID.Select: Multiple processes can be selected without the output of the shared variables, etc., when a partial independent generation of

Perl Language Learning Note 15 Intelligent matching and give-when structure

1. Intelligent matching operatorAlternative binding operators:Find a key in the hash: The comparison of two arrays is exactly the same: Find out if an element exists in the list: The smart match operator is independent of order. ~ ~ Around

Perl lists (list) and Arrays (array)

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

Solve the Problem of Perl calling system return values

The test script is as follows:   My $ run_app_path = "C: // exit_value.pl ";My $ ret_val = system ($ run_app_path );Print "system value is: $ ret_val/N ";$ Ret_val = $ ret_val> 8;Print "return value is: $ ret_val/N ";Exit 0;     The

Perl Study Notes No. 6

1. Since each Hash has a private iterator (iterator), the loop using each can be nested, because different hashThere are different iterator. Although this is just a footer, we should also tell you that you can use keys or valuesFunction, reset the

Perl Study Notes No. 3

1. A given expression has different meanings in different contexts2. In the scalar context, Nums returns the number of its elements. In the list context, its elements are returned.3. Print @ Nums; each element is not separated by spaces unless print

Perl Study Notes No. 8

Application of Regular Expressions 1. // is short for M //./http: // is not easy to read. You can write m {http: //} or M % http: // % 2. The forward slash is not a metacharacter. If it is not a separator, you do not need to use a backslash before

Perl Study Notes No. 9

Use regular expressions to process files 1. S //, S/ABC/Fred/first matches ABC. If ABC is matched, use Fred to replace ABC. If ABC is not matched, do nothing. 2. S // G, replace globally, S/ABC/Fred/g, replace all ABC with Fred 3. Other symbols can

Perl Study Notes No. 12

1. chdir change the working directory... chdir "/etc" or die "cannot chdir to/etc: $! "; If the parameter is null, change it to the main directory. 2. My @ all_files = glob "*"; my @ bz_file = glob "*. bz2"; only 3. My @ all_files = ; my $ dir =

Total Pages: 66 1 .... 62 63 64 65 66 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.