About the origins and characteristics of Perl and Python
Perl is the abbreviation of practical extraction and report Language, created by Larry Wall in 1987, originally designed to facilitate the processing of reports on UNIX, and has become a fully
Copy Code code as follows:
#!/bin/perl
Use strict;
Use warnings;
#定义变量
My $count;
My $input;
My $number;
My $sentence;
My $story;
#定义四个数组
#定义了人物数组
My @nouns =
(
' Dad ',
' TV ',
' Mom ',
' Groucho ',
' Rebecca ',
' Harpo ',
Process processing functions
1. Process Start functionFunction name EvalCall Syntax eval (string)The commentary considers a string as a Perl statement execution.When executed correctly, the system variable $@ is an empty string, and if there is an
I. Process processing functions
1. Process startup Function
Function Name eval
Call the syntax eval (string)
Describe the stringPerlStatement execution.
After the command is correctly executed, the system variable $ @ is an empty string. If an error
Variable scope(a) package variables$x = 1Here, $x is a package variable. There are 2 important things to know about package variables:1) If there is no other declaration, the variable is the package variable;2) package variables are always
Thread: A scan that uses multithreading to handle large amounts of data and encounters a possible deadlock in read-write files. The life cycle of a Perl thread1. Use the Create () method of the Threads package: Use threads; Sub Say_hello {
Perl Common function set 2
I. Process processing functions1. Process startup FunctionFunction Name evalCall the syntax eval_r (string)The description regards string as a Perl statement execution.After the command is correctly executed, the
1. Conditional Control Statement
if (conditional expression)
{
#语句
}
Else
{
#语句
}
The Given...when structure form is:
Given (scalar)
When () {}
When () {}
When () {}
When () {}
The use of the given statement is:
#!/usr/bin/perl-w
In Perl, Srand () provides random number seeds for use by rand (), and Rand () produces random number generators.If Srand () is not invoked before the first call to Rand (), then the system automatically invokes Srand () for you.Calling Srand ()
Thread: A scan that uses multithreading to handle large amounts of data and encounters a possible deadlock in read-write files.The life cycle of a Perl thread 1. Use the Create () method of the threads package: Use threads;Sub Say_hello
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.