Wednesday, October 19, 2022

Subroutine example in perl

 

#subroutine with two parameters
sub mySubroutine{
    $num1 = @_[0];
    $num2 = @_[1];
   
    print  "The value assigned to num1 is $num1\n";
    print  "The value assigned to num2 is $num2";
}
#calling subroutine and passing arguments to it
mySubroutine(3,4);

No comments:

Post a Comment