in reply to issue 'my' sub cannot work

works for me

D:\tmp>perl use warnings; use strict; sub out{ my sub this{my $n=9;print "\n$n"} } &this; __END__ Undefined subroutine &main::this called at - line 12.

This is perl 5, version 32, subversion 1 (v5.32.1) built for MSWin32-x +64-multi-t hread

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: issue 'my' sub cannot work
by Anonymous Monk on Jan 03, 2022 at 16:06 UTC
    O sorry. fine as rule and the problem is it is scratch run interactive in debug and not purged / reset. so most likely garbage 9 is there as one-liner above code is run
    if reset it stops
    Topic should not on this but on "How to purge all everything easily in interactive debug " as it annoys much to set 0 or '' so many 'my' one by one in there