Help for this page
my $rx = qr"^DMSC0022\s+\S+\s+(\w+)$"; my $fmt = "Logfile_Connection_Lost Hostname: %s"; ... if(my @match = /$rx) { printf "$fmt\n", @match; }
my $rx = qr"^DMSC0022\s+\S+\s+(\w+)$"; my $fmt = "Logfile_Connection_Lost Hostname: %1"; ... (my $msg = $fmt) =~ s/%\d+/$match[$1]/e; print "$msg\n"; }