in reply to How can I use $1 in an assigned string
my $make_output = sub { "user $_[0] has accessed the system and is $_[ +1]" }; # apply regex to filter my $output_string = $make_output->( $1, $2 ); [download]