#!/usr/bin/perl -w use strict; my $temp = "Firstword and then the rest of the string"; $temp =~ /^(\w+)/i; my $firstword = $1;