#!/usr/bin/perl use strict; use warnings; sub make_saying { my $salute = shift; my $newfunc = sub { my $target = shift; print "$salute,$target!\n"; }; return $newfunc; # Return a closure } my $f = make_saying("Howdy"); # Create a closure my $g = make_saying("Greetings"); # Create another closure my $h = make_saying("Hello"); # Time passes... $f->("world"); $g->("earthlings"); $h->("Jason");