TRAPS
Accustomed
awk
users should take special note of the following:
Cerebral C programmers should take note of the following:
- Curly brackets are required on ifs and whiles.
- 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.
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.
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.