s/^([^ ]+) +([^ ]+)/$2 $1/; # swap first two words /(\w+)\s*=\s*\1/; # match "foo = foo" /.{80,}/; # match line of at least 80 chars /^(\d+\.?\d*|\.\d+)$/; # match valid number if (/Time: (..):(..):(..)/) { # pull fields out of a line $hours = $1; $minutes = $2; $seconds = $3; }