Perl

What is a Perl subroutine? How to define it?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

It's the perl model for user defined functions (this is also called function like other programming languages). We can define a subroutine with the keyword sub.

sub hello {
  print "hello";
}