my $username = 'john.doe'; $username = quotemeta($username); ($prematch,$match) = $session->waitfor(match => '/$username/', Timeout => 10);