Hi I'm trying to understand subroutines.
#!/usr/bin/perl
&marine()
sub marine {
$n += 1; #Global variable $n
print "Hello, sailor number $n!\n";
}
This doesn't work. Is &marine() incorrect? How would I call the sub marine?
Thanks
Amichai
Hi I'm trying to understand subroutines.
#!/usr/bin/perl
&marine()
sub marine {
$n += 1; #Global variable $n
print "Hello, sailor number $n!\n";
}
This doesn't work. Is &marine() incorrect? How would I call the sub marine?
Thanks
Amichai