首页 > 其他 > 详细

Perl变量及用法

时间:2015-04-24 10:44:43      阅读:248      评论:0      收藏:0      [点我收藏+]

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


本文出自 “天道酬勤” 博客,请务必保留此出处http://lavenliu.blog.51cto.com/5060944/1637800

Perl变量及用法

原文:http://lavenliu.blog.51cto.com/5060944/1637800

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!