What Perl inherits from shell scripts-understanding through comparisons between Perl and shell scripts
Through a comparison of Perl and shell scripts, I'll explain what Perl inherited from shell scripts. Many of Perl's grammar features are inherited from shell scripts.
Perl has the same variable expansion functionality as shell scripts. The string comparison operators eq, ne, gt, ge, lt, le borrow the keywords in the shell script. Comments are the same as shell scripts. Similar to shell scripts, you can write statements at the top level and execute them immediately without compiling.
- Perl's variable expansion is the same as shell script's variable expansion
- Perl's string comparison operators, eq, ne, gt, ge, lt, l, are derived from shell script numerical comparison operators
- Perl comments are the same as shell script comments
- Perl can write sentences at the top level like a shell script
- Perl can be executed immediately without compilation work, just like a shell script