s/^([^ ]*) *([^ ]*)/$2 $1/; # swap first two words
if (/(.)\1/) { # find first doubled char
print "'$1' is the first doubled character\n";
}
if (/Time: (..):(..):(..)/) { # parse out time values
$hours = $1;
$minutes = $2;
$seconds = $3;
}
Note the difference between the $1 and the \1 in
the first and second lines. The last if statement is evidently intended
to handle input lines that contain a date of the form hh:mm:ss.