=head2 Safety net
Perl by default is very forgiving. In order to make it more robust
-it is recommened to start every program with the following lines:
+it is recommended to start every program with the following lines:
#!/usr/bin/perl
use strict;
Exactly like C:
- for ($i=0; $i <= $max; $i++) {
+ for ($i = 0; $i <= $max; $i++) {
...
}
the meantime, here's a quick cheat sheet:
. a single character
- \s a whitespace character (space, tab, newline)
+ \s a whitespace character (space, tab, newline, ...)
\S non-whitespace character
\d a digit (0-9)
\D a non-digit