$what ='steak'; Print " Fred ate $n ${what}s.\n ";
Boolean value
If the number 0 is false, if it is an empty string ' false,
If it is not a number or a string, turn it into a number or string before judging. The string ' 0 ' is also false
Get user input
$line = <STDIN>;
Remove the rightmost line break
$text ="a line \ n"; Chomp ($text); Print $text;
undef value
If the data is quite undef the value is 0, if it is added to the string, it is empty.
Defined function
If you want to determine if a string is undef instead of an empty string, you can use defined. If it is undef, the function returns FALSE. otherwise returns true.
$madonna = <STDIN>; if defined ($madonna)) { print"This isundef"}
Other
The variables in the single quotation mark are output as they are, and if they are double quotation marks can be nested variables.
Automatic conversion between numbers and strings
"Z". The 5*7 result is "Z". 35 "Z35"
A summary of the Perl Language Primer-2nd Chapter