????????????????????????????????????????????????????
???????
1??????
PERL?????????????????????????????????????????????
????
$x = 12345;
if (1217 + 116 == 1333) {
# statement block goes here
}
??????????
PERL??????????????????????????????????????????????????????????????????????????????????????16??????????????????????????????????????
2??8?????16??????
8??????0?????16??????0x?????
????$var1 = 047; (??????????39)
$var2 = 0x1f; (??????????31)
??????????
?? 11.4 ?? -0.3 ??.3 ??
3. ?? 54.1e+02 ?? 5.41e03
????????????????????????????????????????????????????????????????????-309??+308??
????
#!/usr/local/bin/perl
$value = 9.01e+21 + 0.01 - 9.01e+21;
print ("first value is ", $value,
"\n");
$value = 9.01e+21 - 9.01e+21 + 0.01;
print ("second value is ", $value,
"\n");
---------------------------------------------------------
$ program3_3
first value is 0
second value is 0.01
?????????
????C????????????PERL????????????????????????NULL?????NULL???????????????????
.
????????????????????????I?????
$number = 11;
$text = "This text contains the number
$number.";
??$text?????????"This text contains the number
11."
.????????????????????????
Table 3.1. Escape sequences in strings.
| Escape Sequence | Description |
| \a | Bell (beep) |
| \b | Backspace |
| \cn | The Ctrl+n character |
| \e | Escape |
| \E | Ends the effect of \L, \U or \Q |
| \f | Form feed |
| \l | Forces the next letter into lowercase |
| \L | All following letters are lowercase |
| \n | Newline |
| \r | Carriage return |
| \Q | Do not look for special pattern characters |
| \t | Tab |
| \u | Force next letter into uppercase |
| \U | All following letters are uppercase |
| \v | Vertical tab |
\L??\U??\Q?????????\E??????
$a = "T\LHIS IS A \ESTRING"; # same as "This
is a STRING"
.???????????????????????????????????????????????????????I???
$res = "A quote \" and A backslash
\\";
$result = 14;
print ("The value of \$result is
$result.\n")???????
The value of $result is 14.
.????\nnn(8????)??\xnn(16????)?????ASCII??????
$result = "\377"; # this is the character
255,or EOF
$result = "\xff"; # this is also 255
.???????????
??????????????????????????????????????????I??????????????????????????????????????????????????????????????????????????
$text = 'This is two
lines of text
';
????????
$text = "This is two\nlines of text\n";
.??????????????????
??1??
$string = "43";
$number = 28;
$result = $string + $number; # $result = 71
????????????????????????????????????????????????
$result = "hello" * 5; # $result = 0
$result = "12a34" +1; # $result = 13
.????????
??PERL???????????????????????""????????????????????????????????????????????????????????????????????????????