Saxium has asked for the wisdom of the Perl Monks concerning the following question:
outputs#!/usr/bin/perl use strict 'vars'; my $x = 'a'; printme(); my $x = 'b'; printme (); sub printme( ) { print "x: $x\n"; }
x: x: b
Can some help explain why the first my statement is effectively dropped?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: My my
by roboticus (Chancellor) on Apr 13, 2015 at 10:33 UTC | |
|
Re: My my
by monkey_boy (Priest) on Apr 13, 2015 at 10:15 UTC | |
|
Re: My my
by Athanasius (Archbishop) on Apr 13, 2015 at 13:05 UTC | |
|
Re: My my
by Laurent_R (Canon) on Apr 13, 2015 at 17:55 UTC | |
|
Re: My my
by AnomalousMonk (Archbishop) on Apr 13, 2015 at 16:02 UTC | |
|
Re: My my
by Saxium (Initiate) on Apr 23, 2015 at 09:42 UTC |