for example
cpp
#!/usr/bin/perl
$integer = 200;
# 八进制 377 , 十进制为 255
$octal = 0377;
# 十六进制 FF, 十进制为 255
$hexa = 0xff;
$var = "var";
$quote = '$var';
$mul = 4 * 5;
$string = '
hello
world!
';
$foo = v102.111.111;
print "integer = $integer\n";
print "octal = $octal\n";
print "hexa = $hexa\n";
print "var = $var\n";
print "quote = $quote\n";
print "mul = $mul\n";
print "$string\n";
print "foo = $foo\n";
print "文件名 ". __FILE__ . "\n";
print "行号 " . __LINE__ ."\n";
运行结果如下所示
参考:perl菜鸟教程