Fri, 17 May 2024


How to declare and call a subroutine in Perl?

By: Peter, NetArt Media
Mon, 6 December 2021

sub MY_SUB
{
local ( $param_1, $param_2 ) = @_ ;
print "\n Called MY_SUB \n \t $param_1 \n \t $param_2 \n" ;
}

#
# MAIN part of the program
#
for ( $i=0; $i<3; $i++ )
{
&MY_SUB ( "text", 123 ) ;
}


Category: Web Development
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox