Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Incorrect variable name in perlintro #9289

Closed
p5pRT opened this issue Apr 13, 2008 · 5 comments
Closed

[PATCH] Incorrect variable name in perlintro #9289

p5pRT opened this issue Apr 13, 2008 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 13, 2008

Migrated from rt.perl.org#52860 (status was 'resolved')

Searchable as RT52860$

@p5pRT
Copy link
Author

p5pRT commented Apr 13, 2008

From kraai@ftbfs.org

Howdy,

perlintro contains the following example and paragraph​:

my $x = "foo";
my $some\_condition = 1;
if \($some\_condition\) \{
    my $y = "bar";
    print $x;           \# prints "foo"
    print $y;           \# prints "bar"
\}
print $x;               \# prints "foo"
print $y;               \# prints nothing; $y has fallen out of scope

Using C<my> in combination with a C<use strict;> at the top of
your Perl scripts means that the interpreter will pick up certain common
programming errors. For instance, in the example above, the final
C<print $b> would cause a compile-time error and prevent you from
running the program. Using C<strict> is highly recommended.

Change 28554 renamed the variables from $a and $b to $x and $y,
respectively, but did not update the variable name in the second to
last sentence of the following paragraph. The attached patch fixes
this.

--
Matt

@p5pRT
Copy link
Author

p5pRT commented Apr 13, 2008

From kraai@ftbfs.org

0001-Change-b-to-y.patch
From f721bdb1cf3b02d9115c541c63d032a5bdddfe92 Mon Sep 17 00:00:00 2001
From: Matt Kraai <kraai@ftbfs.org>
Date: Sun, 13 Apr 2008 15:54:57 -0700
Subject: [PATCH] Change $b to $y.

---
 pod/perlintro.pod |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pod/perlintro.pod b/pod/perlintro.pod
index 210890f..bcb35f0 100644
--- a/pod/perlintro.pod
+++ b/pod/perlintro.pod
@@ -302,7 +302,7 @@ are defined.
 Using C<my> in combination with a C<use strict;> at the top of
 your Perl scripts means that the interpreter will pick up certain common
 programming errors.  For instance, in the example above, the final
-C<print $b> would cause a compile-time error and prevent you from
+C<print $y> would cause a compile-time error and prevent you from
 running the program.  Using C<strict> is highly recommended.
 
 =head2 Conditional and looping constructs
-- 
1.5.5

@p5pRT
Copy link
Author

p5pRT commented Apr 18, 2008

From @rgs

Thanks, applied.

@p5pRT
Copy link
Author

p5pRT commented Apr 18, 2008

From [Unknown Contact. See original ticket]

Thanks, applied.

@p5pRT
Copy link
Author

p5pRT commented Apr 18, 2008

@rgs - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant