×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

Perl example - How to declare and call a subroutine in Perl?


Perl - How to declare and call a subroutine in Perl?

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: Perl

 
<< Go back