sub CheckLogfileForToday() { my $today = (qw)[(localtime)[6]]; # Keep trying until one matches, so the default regex is set. "Sun:" =~ m/^$today:/i or "Mon:" =~ m/^$today:/i or "Tue:" =~ m/^$today:/i or "Wed:" =~ m/^$today:/i or "Thu:" =~ m/^$today:/i or "Fri:" =~ m/^$today:/i or "Sat:" =~ m/^$today:/i; while () { if (m//) { # Now use the default regex } } } ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl