Nested method : Nested « Subroutine « Perl






Nested method

   

#!/usr/bin/perl -w

use strict;

oneMethod(1,2,3);

sub oneMethod {
    print "In oneMethod, arguments are @_\n";
    anotherMethod(4,5,6);
    print "Back in oneMethod, arguments are @_\n";
}

sub anotherMethod {
    print "In anotherMethod, arguments are @_\n";
}
          

   
    
    
  








Related examples in the same category

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