Hello All,
I'm a newbie in the Perl. I'm encountering a bit of difficulty understanding various methodology in subroutine calls. Can any one describe the arguments that are getting passed?
Pattern 1: (most common)
sub mysub{
}
Comments: Understood
-------------------------------------
Pattern 2:
sub mysub($)
{
my ($var1, $var2) = @;
.
.
}
Comments : Couldn't understand ($) in the passing argument
---------------------------------------
Pattern 3:
sub mysub(;$)
{
my ($var1, $var2) = @;
.
.
}
Comments : Couldn't understand mysub(;$)
----------------------------------------
Pattern 4:
sub mysub($;$)
{
}
Comments : Couldn't understand mysub($;$)
------------------------------------------
Pattern 5:
sub mysqub($$$$)
{
}
Comments : Couldn't understand mysub($$$$)
-------------------------------------------
Thanking all in advance.
I'm a newbie in the Perl. I'm encountering a bit of difficulty understanding various methodology in subroutine calls. Can any one describe the arguments that are getting passed?
Pattern 1: (most common)
sub mysub{
}
Comments: Understood
-------------------------------------
Pattern 2:
sub mysub($)
{
my ($var1, $var2) = @;
.
.
}
Comments : Couldn't understand ($) in the passing argument
---------------------------------------
Pattern 3:
sub mysub(;$)
{
my ($var1, $var2) = @;
.
.
}
Comments : Couldn't understand mysub(;$)
----------------------------------------
Pattern 4:
sub mysub($;$)
{
}
Comments : Couldn't understand mysub($;$)
------------------------------------------
Pattern 5:
sub mysqub($$$$)
{
}
Comments : Couldn't understand mysub($$$$)
-------------------------------------------
Thanking all in advance.