in reply to Re: Inner subroutines?
in thread Inner subroutines?
You could do just as well inside another subroutine instead of just a bare block
I'm not seeing that:
use warnings; use strict; use warnings; use strict; sub outer { my $data = 10; sub test { print $data; } } outer(); test(); --output:-- Variable "$data" will not stay shared at t.pl line 8. 10
Nor here:
use warnings; use strict; sub outer { my $data = 10; sub test { print $data; } test(); } outer(); --output:-- Variable "$data" will not stay shared at t.pl line 8. 10
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Inner subroutines?
by blakew (Monk) on Feb 18, 2011 at 00:27 UTC |