Hi, My sample code as below, there are two styles subname and subnam()
#!C:\Perl\bin\perl.exe
use strict;
use warnings;
use 5.010;
&marine(); # style 1
&marine; # style 2
sub marine {
state $n = 0; # private, persistent variable $n
$n += 1;
print "Hello, sailor number $n!\n";
}
Which one(&marine();
and &marine;
) is more popular if there is no arguments in a sub? Thank you.