programming-examples/perl/Subroutine/A subroutine is defined by the sub keyword and the block of code that follows.pl
2019-11-15 12:59:38 +01:00

13 lines
235 B
Perl

#!/usr/local/bin/perl -w
# Declare the subroutine named usage
sub usage
{
my ($program, $exitCode) = @_;
print "Usage: $program [-v] [-h]\n";
exit $exitCode;
}
usage ($0, 1);