perl--Learning Record (real-time update)

Source: Internet
Author: User
Tags scalar

    1. The scalar quantity (Varibale) begins with the dollar sign ($), which also becomes the magic symbol (SIGIL). Perl uses a magic character to differentiate what type of variable it is.
    2. Most of the variable names in Perl are used in all lowercase . The use of all-uppercase (such as $ARGV) generally represents a variable of special significance.
    3. Scalar variable interpolation (also called double-quote interpolation)in a string: $meal = "abc";
      $barney = "Fred ate a $meal"
      or $barney = "Fred ate a ${meal}"
    4. Be sure to add the curly braces {} that represent the wiring around the code block in the conditional statement.
    5. $line = <STDIN>;
    6. A list refers to an ordered set of scalars, which refers to data; An array is a variable that stores a list and refers to a variable.
    7. The last array index value of the array is $ #name, or 1 (negative array index value, 1 for the last one).
    8. (1.. 100) represents a list of 1 to 100 components ... is the range operator (range operator) and can only be small to large.
    9. QW (Fred Barney Betty) is equivalent to ("Fred", "Barnet", "Betty") to save a lot of meaningless quotes.
    10. ($rocks [0], $rocks [1], $rocks [2]) is equivalent to @rocks.

perl--Learning Record (real-time update)

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.