hhnf333 发表于 2018-8-30 11:22:55

Perl变量及用法

Variable types and their uses  
| Type       | Sigil | Example   | Is a Name For                        |
  
|------------+-------+-----------+----------------------------------------|
  
| Scalar   | $   | $cents    | An individual value (number or string) |
  
| Array      | @   | @large    | A list of values, keyed by number      |
  
| Hash       | %   | %interest | A group of values, keyed by string   |
  
| Subroutine | &   | &how      | A callable chunk of Perl code          |
  
| Typeglob   | *   | *struck   | Everything named struck                |
  

  
# for example
  
my $phrase = "Howdy, world!\n";# Create a variable
  
print $phrase;                   # Print the variable


页: [1]
查看完整版本: Perl变量及用法