nested subroutine : Nested « Subroutine « Perl






nested subroutine

   

sub outer
{
    my $s = "Inside the inner subroutine.\n";

    sub inner
    {
        my $s2 = $s;
        print $s2;
    }

    inner();
}

outer();

   
    
    
  








Related examples in the same category

1.Nested method
2.Nested subroutine with local variable
3.A nested subroutine.