Skip to content

Commit

Permalink
Refine the changes to perlintro.pod after feedback and discussion.
Browse files Browse the repository at this point in the history
Following useful feedback and suggestions from Neil Bowers, Jason McIntosh
and Dan Book, try to make the sentances shorter and clearer. Hopefully also
avoid some potential abmiguities about "special variables" not just being
all-punctuation or scalars.
  • Loading branch information
nwc10 authored and khwilliamson committed Jul 17, 2021
1 parent 6914423 commit 3ccfac5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pod/perlintro.pod
Expand Up @@ -161,9 +161,8 @@ A scalar represents a single value:
my $answer = 42;

Scalar values can be strings, integers or floating point numbers, and Perl
will automatically convert between them as required. There is no need
to pre-declare your variable types - just declare their names using
the C<my> keyword the first time you use them. (This is one of the
will automatically convert between them as required. You have to declare
them using the C<my> keyword the first time you use them. (This is one of the
requirements of C<use strict;>.)

Scalar values can be used in various ways:
Expand All @@ -172,9 +171,8 @@ Scalar values can be used in various ways:
print "The animal is $animal\n";
print "The square of $answer is ", $answer * $answer, "\n";

There are a number of "magic" scalars with names that use punctuation symbols,
and a few that are all uppercase letters.
These special variables are used for all
Perl defines a number of special scalars with short names, often single
punctuation marks or digits. These variables are used for all
kinds of purposes, and are documented in L<perlvar>. The only one you
need to know about for now is C<$_> which is the "default variable".
It's used as the default argument to a number of functions in Perl, and
Expand Down

0 comments on commit 3ccfac5

Please sign in to comment.