# create code reference my $anon_sub = sub { print "Hello world!\n" }; # execute the code $anon_sub->();