Perl Learning II: Simple variables

Source: Internet
Author: User

String variable: ${}
1. Single quote: Do not replace the variable, do not escape, the string can cross the line.
2. Double quotes: variable substitution (greedy matching principle), support escape character (escape character can be seen separately)
3. Anti-Quote

Special notation for strings:
QQ (...)
Q (...)
() can be swapped for <>,{},[],//,;;, etc. paired characters.

Variable Initial value:
Undef $a
Defined $a
Generally used in conditional judgment
Integer initial value is 0
String initial value is empty string

Related functions:
Length ()----string lengths, number of digits
Chop ()
Chomp ()
The meaning of $/
The above function is rich in usage and can be removed at any end of the character.

Perl Learning II: Simple variables

Related Article

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.