So is there a sensible explanation for formats or is that just considered an exception? | [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
Following on what duff said, the "statement terminator" is either a semi-colon, end-of-block, or end-of-file. The semi-colon is actually a "statement separator", so when you want two or more statements in a perl script or block (which is just about always), you need to put semicolons between them.
Spaces, tabs and newlines (when they are not enclosed in any sort of quotation marks) are only useful as token separators (they are often "optional" in this role). Of course, they also serve as aids to human readability, but they only have a functional syntactic role when they are required as token separators (e.g. you must have whitespace between "use" and the name of a module or pragma), and in those cases, spaces, tabs and newlines are interchangeable -- perl doesn't care what kind of whitespace you provide, so long as you put it where it's needed:
#!/usr/bin/perl
# (shebang line syntax is dictated by unix shell)
use
strict;use
warnings;my
@a
=
qw
(1
2 3);print
"@a\n"
| [reply] [Watch: Dir/Any] [d/l] |
| [reply] [Watch: Dir/Any] |
#!/usr/bin/perl
use strict;
use warnings;
$
#
_
=
1
__END__
| [reply] [Watch: Dir/Any] [d/l] |
Newlines are unnecessary, check out the Obfuscation page here!
| [reply] [Watch: Dir/Any] |
Perl has no statement terminator; just a statement separator.
| [reply] [Watch: Dir/Any] |