to be executable first, so C<chmod 755 script.pl> (under Unix).
For more information, including instructions for other platforms such as
-Windows and MacOS, read L<perlrun>.
+Windows and Mac OS, read L<perlrun>.
=head2 Basic syntax overview
we're getting just a single value out of the array -- you ask for a scalar,
you get a scalar.
-To get multiple values from a array:
+To get multiple values from an array:
@animals[0,1]; # gives ("camel", "llama");
@animals[0..2]; # gives ("camel", "llama", "owl");
}
The C style for loop is rarely needed in Perl since Perl provides
-the the more friendly list scanning C<foreach> loop.
+the more friendly list scanning C<foreach> loop.
=item foreach
# a cheap and nasty way to break an email address up into parts
- if ($email =~ /([^@])+@(.+)/) {
+ if ($email =~ /([^@]+)@(.+)/) {
print "Username is $1\n";
print "Hostname is $2\n";
}
=head2 Using Perl modules
Perl modules provide a range of features to help you avoid reinventing
-the wheel, and can be downloaded from CPAN (http://www.cpan.org). A
+the wheel, and can be downloaded from CPAN ( http://www.cpan.org/ ). A
number of popular modules are included with the Perl distribution
itself.