PERL traps for awk users
Accustomed awk users should take special note of the following:
PERL traps for C programmers
Cerebral C programmers should take note of the following:
- Curly brackets are required on if's and while's.
- You should use "elsif" rather than "else if"
- Break and continue become last and next, respectively.
- There's no switch statement.
- Variables begin with $ or @ in perl.
- Printf does not implement *.
- Comments begin with #, not /*.
- You can't take the address of anything.
- ARGV must be capitalized.
- The "system" calls link, unlink, rename, etc. return nonzero for success, not 0.
- Signal handlers deal with signal names, not numbers.
PERL traps for sed users
Seasoned sed programmers should take note of the following:
- Backreferences in substitutions use $ rather than \.
- The pattern matching metacharacters (, ), and | do not have backslashes in front.
- The range operator is .. rather than comma.
PERL traps for shell programmers
Sharp shell programmers should take note of the following:
- The backtick operator does variable interpretation without regard to the
presence of single quotes in the command.
- The backtick operator does no translation of the return value, unlike csh.
- Shells (especially csh) do several levels of substitution on each command line.
Perl does substitution only in certain constructs such as double quotes,
backticks, angle brackets and search patterns.
- Shells interpret scripts a little bit at a time.
Perl compiles the whole program before executing it.
- The arguments are available via @ARGV, not $1, $2, etc.
- The environment is not automatically made available as variables.
Click here to go back to the Perl index