in reply to Make $^V and "my" implicit
So what does the following code output?
no my; $user= 'World'; sub greet { print "Hello, $user"; }; greet();
Before you answer, compare this to the two Perl programs that reduce to the same code:
use strict; my $user= 'World'; sub greet { my $user; print "Hello, $user"; }; greet();
use strict; my $user= 'World'; sub greet { print "Hello, $user"; }; greet();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Make $^V and "my" implicit
by gunzip (Pilgrim) on Feb 03, 2014 at 17:47 UTC | |
by Corion (Patriarch) on Feb 03, 2014 at 17:52 UTC | |
by gunzip (Pilgrim) on Feb 03, 2014 at 18:02 UTC | |
|